Skip to content

Commit

Permalink
Allow datasets without time dim in recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Aug 16, 2023
1 parent d191415 commit 9847127
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zampy/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def run(self) -> None:

ds = converter.convert(ds, dataset, convention=self.convention)

ds = ds.resample(time=self.frequency).mean()
if "time" in ds.dims: # Dataset with only DEM (e.g.) has no time dim.
ds = ds.resample(time=self.frequency).mean()

comp = dict(zlib=True, complevel=5)
encoding = {var: comp for var in ds.data_vars}
Expand Down

0 comments on commit 9847127

Please sign in to comment.