(self)
| 7573 | |
| 7574 | @requires_cupy |
| 7575 | def test_from_cupy(self) -> None: |
| 7576 | import cupy as cp |
| 7577 | |
| 7578 | arr = np.array([1, 2, 3]) |
| 7579 | da = xr.DataArray( |
| 7580 | cp.array(arr), dims="x", coords={"lat": ("x", cp.array(arr + 3))} |
| 7581 | ) |
| 7582 | |
| 7583 | expected = xr.DataArray(arr, dims="x", coords={"lat": ("x", arr + 3)}) |
| 7584 | assert_identical(da.as_numpy(), expected) |
| 7585 | np.testing.assert_equal(da.to_numpy(), arr) |
| 7586 | |
| 7587 | @requires_dask |
| 7588 | @requires_pint |
nothing calls this directly
no test coverage detected