MCPcopy Create free account
hub / github.com/NCAR/wrf-python / func_wrapper

Function func_wrapper

src/wrf/decorators.py:40–47  ·  view source on GitHub ↗
(wrapped, instance, args, kwargs)

Source from the content-addressed store, hash-verified

38 """
39 @wrapt.decorator
40 def func_wrapper(wrapped, instance, args, kwargs):
41 desired_units = from_args(wrapped, "units", *args, **kwargs)["units"]
42 u_cleaned = dealias_and_clean_unit(desired_units)
43 check_units(u_cleaned, unit_type)
44
45 # Unit conversion done here
46 return do_conversion(wrapped(*args, **kwargs), unit_type,
47 alg_unit, desired_units)
48
49 return func_wrapper
50

Callers

nothing calls this directly

Calls 11

from_argsFunction · 0.85
dealias_and_clean_unitFunction · 0.85
check_unitsFunction · 0.85
do_conversionFunction · 0.85
isstrFunction · 0.85
iter_left_indexesFunction · 0.85
viewitemsFunction · 0.85
to_npFunction · 0.85
viewvaluesFunction · 0.85
default_fillFunction · 0.85
_extract_and_transposeFunction · 0.85

Tested by

no test coverage detected