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

Method test_item

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

Source from the content-addressed store, hash-verified

2624 assert_identical(expected, actual)
2625
2626 def test_item(self, dtype):
2627 array = np.arange(10).astype(dtype) * unit_registry.m
2628 data_array = xr.DataArray(data=array)
2629
2630 func = method("item", 2)
2631
2632 expected = func(strip_units(data_array)) * unit_registry.m
2633 actual = func(data_array)
2634
2635 assert_duckarray_allclose(expected, actual)
2636
2637 @pytest.mark.parametrize(
2638 "unit,error",

Callers

nothing calls this directly

Calls 6

methodClass · 0.85
strip_unitsFunction · 0.85
arangeMethod · 0.80
funcFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected