(self)
| 8330 | |
| 8331 | @requires_pint |
| 8332 | def test_from_pint(self) -> None: |
| 8333 | from pint import Quantity |
| 8334 | |
| 8335 | arr = np.array([1, 2, 3]) |
| 8336 | ds = xr.Dataset( |
| 8337 | {"a": ("x", Quantity(arr, units="Pa"))}, |
| 8338 | coords={"lat": ("x", Quantity(arr + 3, units="m"))}, |
| 8339 | ) |
| 8340 | |
| 8341 | expected = xr.Dataset({"a": ("x", [1, 2, 3])}, coords={"lat": ("x", arr + 3)}) |
| 8342 | assert_identical(ds.as_numpy(), expected) |
| 8343 | |
| 8344 | @requires_sparse |
| 8345 | def test_from_sparse(self) -> None: |
nothing calls this directly
no test coverage detected