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

Method test_unstack

xarray/tests/test_units.py:2106–2116  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

2104 assert_identical(expected, actual)
2105
2106 def test_unstack(self, dtype):
2107 array = np.linspace(0, 5, 3 * 10).astype(dtype) * unit_registry.m
2108 variable = xr.Variable("z", array)
2109
2110 expected = attach_units(
2111 strip_units(variable).unstack(z={"x": 3, "y": 10}), extract_units(variable)
2112 )
2113 actual = variable.unstack(z={"x": 3, "y": 10})
2114
2115 assert_units_equal(expected, actual)
2116 assert_identical(expected, actual)
2117
2118 @pytest.mark.parametrize(
2119 "unit,error",

Callers

nothing calls this directly

Calls 9

unstackMethod · 0.95
assert_identicalFunction · 0.90
attach_unitsFunction · 0.85
strip_unitsFunction · 0.85
extract_unitsFunction · 0.85
assert_units_equalFunction · 0.85
linspaceMethod · 0.80
astypeMethod · 0.45
unstackMethod · 0.45

Tested by

no test coverage detected