Skip to content

Commit

Permalink
Merge branch 'main' into coords_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas authored Nov 4, 2024
2 parents 164e313 + ba46a77 commit edaa764
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
7 changes: 1 addition & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,9 @@ virtual_ds.virtualize.to_kerchunk('combined.json', format='json')
Now you can open your shiny new Zarr store instantly:

```python
fs = fsspec.filesystem('reference', fo='combined.json')
m = fs.get_mapper('')

ds = xr.open_dataset(m, engine='kerchunk', chunks={}) # normal xarray.Dataset object, wrapping dask/numpy arrays etc.
ds = xr.open_dataset('combined.json', engine='kerchunk', chunks={}) # normal xarray.Dataset object, wrapping dask/numpy arrays etc.
```

(Since we serialized the cached results using the kerchunk specification then opening this zarr store still requires using fsspec via the kerchunk xarray backend.)

No data has been loaded or copied in this process, we have merely created an on-disk lookup table that points xarray into the specific parts of the original netCDF files when it needs to read each chunk.

See the [Usage docs page](#usage) for more details.
Expand Down
9 changes: 1 addition & 8 deletions virtualizarr/readers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
Variable,
open_dataset,
)
from xarray.backends import AbstractDataStore, BackendArray
from xarray.backends import AbstractDataStore
from xarray.core.indexes import PandasIndex

from virtualizarr.manifests import ManifestArray
from virtualizarr.utils import _FsspecFSFromFilepath

XArrayOpenT = str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore
Expand All @@ -34,12 +33,6 @@
DataTree = Any


class ManifestBackendArray(ManifestArray, BackendArray):
"""Using this prevents xarray from wrapping the KerchunkArray in ExplicitIndexingAdapter etc."""

...


def open_loadable_vars_and_indexes(
filepath: str,
loadable_variables,
Expand Down

0 comments on commit edaa764

Please sign in to comment.