Skip to content

Commit

Permalink
workaround to xarray chunk encoding causing problem on parallel write…
Browse files Browse the repository at this point in the history
… with zarr
  • Loading branch information
gtramonte committed Dec 17, 2024
1 parent d394efd commit 6c08789
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geokube/core/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,10 @@ def to_netcdf(self, path, encoding: bool = True):
self.to_xarray(encoding=encoding).to_netcdf(path=path)

def to_zarr(self, path, encoding: bool = True, **kwargs):
self.to_xarray(encoding=encoding).chunk('auto').to_zarr(path,**kwargs)
kube = self.to_xarray(encoding=encoding)
for var in kube:
del kube[var].encoding['chunks']
kube.chunk('auto').to_zarr(path,**kwargs)

@geokube_logging
def to_csv(self, path, encoding: bool = True):
Expand Down

0 comments on commit 6c08789

Please sign in to comment.