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

Method test_from_cupy

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

Source from the content-addressed store, hash-verified

3128
3129 @requires_cupy
3130 def test_from_cupy(self, Var):
3131 if Var is IndexVariable:
3132 pytest.skip("cupy in default indexes is not supported at the moment")
3133 import cupy as cp
3134
3135 arr = np.array([1, 2, 3])
3136 v = Var("x", cp.array(arr))
3137
3138 assert_identical(v.as_numpy(), Var("x", arr))
3139 np.testing.assert_equal(v.to_numpy(), arr)
3140
3141 @requires_dask
3142 @requires_pint

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