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

Method test_zeros_like

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

Source from the content-addressed store, hash-verified

2883 assert not isinstance(v, np.ndarray)
2884
2885 def test_zeros_like(self) -> None:
2886 orig = Variable(
2887 dims=("x", "y"), data=[[1.5, 2.0], [3.1, 4.3]], attrs={"foo": "bar"}
2888 )
2889 assert_identical(zeros_like(orig), full_like(orig, 0))
2890 assert_identical(zeros_like(orig, dtype=int), full_like(orig, 0, dtype=int))
2891
2892 def test_ones_like(self) -> None:
2893 orig = Variable(

Callers

nothing calls this directly

Calls 4

VariableClass · 0.90
assert_identicalFunction · 0.90
zeros_likeFunction · 0.90
full_likeFunction · 0.90

Tested by

no test coverage detected