MCPcopy Index your code
hub / github.com/pydata/xarray / dimensionality

Function dimensionality

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

Source from the content-addressed store, hash-verified

56
57def is_compatible(unit1, unit2):
58 def dimensionality(obj):
59 if isinstance(obj, unit_registry.Quantity | unit_registry.Unit):
60 unit_like = obj
61 else:
62 unit_like = unit_registry.dimensionless
63
64 return unit_like.dimensionality
65
66 return dimensionality(unit1) == dimensionality(unit2)
67

Callers 1

is_compatibleFunction · 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…