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

Method test_isel

xarray/tests/test_units.py:1885–1898  ·  view source on GitHub ↗
(self, variable, indexers, dask, dtype)

Source from the content-addressed store, hash-verified

1883 ),
1884 )
1885 def test_isel(self, variable, indexers, dask, dtype):
1886 if dask:
1887 variable = variable.chunk(dict.fromkeys(variable.dims, 2))
1888 quantified = xr.Variable(
1889 variable.dims, variable.data.astype(dtype) * unit_registry.s
1890 )
1891
1892 expected = attach_units(
1893 strip_units(quantified).isel(indexers), extract_units(quantified)
1894 )
1895 actual = quantified.isel(indexers)
1896
1897 assert_units_equal(expected, actual)
1898 assert_identical(expected, actual)
1899
1900 @pytest.mark.parametrize(
1901 "unit,error",

Callers

nothing calls this directly

Calls 9

iselMethod · 0.95
assert_identicalFunction · 0.90
attach_unitsFunction · 0.85
strip_unitsFunction · 0.85
extract_unitsFunction · 0.85
assert_units_equalFunction · 0.85
chunkMethod · 0.45
astypeMethod · 0.45
iselMethod · 0.45

Tested by

no test coverage detected