We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8074978 commit 2011405Copy full SHA for 2011405
weatherbench2/evaluation.py
@@ -382,6 +382,10 @@ def _get_output_path(
382
383
def _to_netcdf(dataset: xr.Dataset, filename: str) -> None:
384
with fsspec.open(filename, 'wb', auto_mkdir=True) as f:
385
+ for coord in dataset.coords:
386
+ if dataset[coord].dtype == 'timedelta64[ns]':
387
+ # Make sure to also override all other existing encodings.
388
+ dataset[coord].encoding = {'dtype': 'int32'}
389
f.write(dataset.to_netcdf())
390
391
0 commit comments