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

Method test_numpy_same_methods

xarray/tests/test_variable.py:1082–1088  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1080 assert source_ndarray(v.values) is d2
1081
1082 def test_numpy_same_methods(self):
1083 v = Variable([], np.float32(0.0))
1084 assert v.item() == 0 # type: ignore[attr-defined]
1085 assert type(v.item()) is float # type: ignore[attr-defined]
1086
1087 v = IndexVariable("x", np.arange(5))
1088 assert 2 == v.searchsorted(2) # type: ignore[attr-defined]
1089
1090 @pytest.mark.parametrize(
1091 "values, unit",

Callers

nothing calls this directly

Calls 4

VariableClass · 0.90
IndexVariableClass · 0.90
typeFunction · 0.85
arangeMethod · 0.80

Tested by

no test coverage detected