(self)
| 7516 | class TestNumpyCoercion: |
| 7517 | # TODO once flexible indexes refactor complete also test coercion of dimension coords |
| 7518 | def test_from_numpy(self) -> None: |
| 7519 | da = xr.DataArray([1, 2, 3], dims="x", coords={"lat": ("x", [4, 5, 6])}) |
| 7520 | |
| 7521 | assert_identical(da.as_numpy(), da) |
| 7522 | np.testing.assert_equal(da.to_numpy(), np.array([1, 2, 3])) |
| 7523 | np.testing.assert_equal(da["lat"].to_numpy(), np.array([4, 5, 6])) |
| 7524 | |
| 7525 | def test_to_numpy(self) -> None: |
| 7526 | arr = np.array([1, 2, 3]) |
nothing calls this directly
no test coverage detected