(self)
| 5746 | ds.isel(time=slice(10), dim1=[0]).isel(dim1=0, dim2=-1) |
| 5747 | |
| 5748 | def test_lazy_load_duck_array(self) -> None: |
| 5749 | store = AccessibleAsDuckArrayDataStore() |
| 5750 | create_test_data().dump_to_store(store) |
| 5751 | |
| 5752 | for decode_cf in [True, False]: |
| 5753 | ds = open_dataset(store, decode_cf=decode_cf) |
| 5754 | with pytest.raises(UnexpectedDataAccess): |
| 5755 | _ = ds["var1"].values |
| 5756 | |
| 5757 | # these should not raise UnexpectedDataAccess: |
| 5758 | _ = ds.var1.data |
| 5759 | ds.isel(time=10) |
| 5760 | ds.isel(time=slice(10), dim1=[0]).isel(dim1=0, dim2=-1) |
| 5761 | repr(ds) |
| 5762 | |
| 5763 | # preserve the duck array type and don't cast to array |
| 5764 | assert isinstance(ds["var1"].load().data, DuckArrayWrapper) |
| 5765 | assert isinstance( |
| 5766 | ds["var1"].isel(dim2=0, dim1=0).load().data, DuckArrayWrapper |
| 5767 | ) |
| 5768 | |
| 5769 | ds.close() |
| 5770 | |
| 5771 | def test_dropna(self) -> None: |
| 5772 | x = np.random.randn(4, 4) |
nothing calls this directly
no test coverage detected