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

Method test_ones_like

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

Source from the content-addressed store, hash-verified

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(
2894 dims=("x", "y"), data=[[1.5, 2.0], [3.1, 4.3]], attrs={"foo": "bar"}
2895 )
2896 assert_identical(ones_like(orig), full_like(orig, 1))
2897 assert_identical(ones_like(orig, dtype=int), full_like(orig, 1, dtype=int))
2898
2899 def test_numpy_ndarray_subclass(self):
2900 class SubclassedArray(np.ndarray):

Callers

nothing calls this directly

Calls 4

VariableClass · 0.90
assert_identicalFunction · 0.90
ones_likeFunction · 0.90
full_likeFunction · 0.90

Tested by

no test coverage detected