MCPcopy
hub / github.com/pydata/xarray / array_extract_units

Function array_extract_units

xarray/tests/test_units.py:89–96  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

87
88
89def array_extract_units(obj):
90 if isinstance(obj, xr.Variable | xr.DataArray | xr.Dataset):
91 obj = obj.data
92
93 try:
94 return obj.units
95 except AttributeError:
96 return None
97
98
99def array_strip_units(array):

Callers 3

extract_unitsFunction · 0.85
test_aggregationMethod · 0.85
test_numpy_methodsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…