Skip to content

Commit

Permalink
Fix: to_zarr was saving the whole file and we don't need the GRIB any…
Browse files Browse the repository at this point in the history
…more
  • Loading branch information
alexamici committed Oct 3, 2024
1 parent 909d83e commit 5f692ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray_ecmwf/engine_ecmwf.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def cached_empty_dataset(self, request: dict[str, Any]) -> Iterator[xr.Dataset]:
os.makedirs(self.cache_folder, exist_ok=True)

if not os.path.exists(path):
with self.retrieve(request, override_cache_file=True) as read_ds:
with self.retrieve(request) as read_ds:
# check again as the retrieve may be long
with xr.backends.locks.get_write_lock(f"{HOSTNAME}-zarr"): # type: ignore
if not os.path.exists(path):
Expand Down Expand Up @@ -170,7 +170,7 @@ def open_dataset( # type:ignore
request_chunker = request_chunker_class(
filename_or_obj, request_chunks, **request_chunker_kwargs
)
open_dataset_kwargs = {"engine": "cfgrib"} | open_dataset_kwargs
open_dataset_kwargs = {"engine": "cfgrib", "chunks": {}} | open_dataset_kwargs
if not cache_kwargs.get("cache_file", True):
open_dataset_kwargs = open_dataset_kwargs | {"indexpath": ""}

Expand Down

0 comments on commit 5f692ed

Please sign in to comment.