(self)
| 8371 | @requires_dask |
| 8372 | @requires_pint |
| 8373 | def test_from_pint_wrapping_dask(self) -> None: |
| 8374 | import dask |
| 8375 | from pint import Quantity |
| 8376 | |
| 8377 | arr = np.array([1, 2, 3]) |
| 8378 | d = dask.array.from_array(arr) |
| 8379 | ds = xr.Dataset( |
| 8380 | {"a": ("x", Quantity(d, units="Pa"))}, |
| 8381 | coords={"lat": ("x", Quantity(d, units="m") * 2)}, |
| 8382 | ) |
| 8383 | |
| 8384 | result = ds.as_numpy() |
| 8385 | expected = xr.Dataset({"a": ("x", arr)}, coords={"lat": ("x", arr * 2)}) |
| 8386 | assert_identical(result, expected) |
| 8387 | |
| 8388 | |
| 8389 | def test_string_keys_typing() -> None: |
nothing calls this directly
no test coverage detected