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

Method test_from_numpy

xarray/tests/test_variable.py:3086–3090  ·  view source on GitHub ↗
(self, Var)

Source from the content-addressed store, hash-verified

3084@pytest.mark.parametrize("Var", [Variable, IndexVariable])
3085class TestNumpyCoercion:
3086 def test_from_numpy(self, Var):
3087 v = Var("x", [1, 2, 3])
3088
3089 assert_identical(v.as_numpy(), v)
3090 np.testing.assert_equal(v.to_numpy(), np.array([1, 2, 3]))
3091
3092 @requires_dask
3093 def test_from_dask(self, Var):

Callers

nothing calls this directly

Calls 3

assert_identicalFunction · 0.90
as_numpyMethod · 0.45
to_numpyMethod · 0.45

Tested by

no test coverage detected