Skip to content

Commit

Permalink
fix: use reference fs mapper instead of raw dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill888 committed Jun 21, 2024
1 parent e62615b commit 08e5e57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion odc/loader/testing/mem_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from contextlib import contextmanager
from typing import Any, Iterator, Sequence

import fsspec
import numpy as np
import xarray as xr
from odc.geo.geobox import GeoBox
Expand Down Expand Up @@ -61,7 +62,8 @@ def _from_zarr_spec(
spec_doc: dict[str, Any],
regen_coords: bool = False,
) -> xr.Dataset:
xx = xr.open_dataset(spec_doc, engine="zarr")
rfs = fsspec.filesystem("reference", fo=spec_doc)
xx = xr.open_dataset(rfs.getmapper(), engine="zarr")
gbox = xx.odc.geobox
if gbox is not None and regen_coords:
# re-gen x,y coords from geobox
Expand Down

0 comments on commit 08e5e57

Please sign in to comment.