Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ requirements:
- lxml
- mache >=1.11.0
- matplotlib-base >=3.9.0
- mpas_tools >=1.2.2,<2.0.0
- mpas_tools >=1.3.0,<2.0.0
- nco >=4.8.1,!=5.2.6
- netcdf4
- numpy >=2.0,<3.0
Expand Down
2 changes: 1 addition & 1 deletion dev-spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gsw
lxml
mache >=1.11.0
matplotlib-base>=3.9.0
mpas_tools >=1.2.2,<2.0.0
mpas_tools >=1.3.0,<2.0.0
nco>=4.8.1,!=5.2.6
netcdf4
numpy>=2.0,<3.0
Expand Down
6 changes: 6 additions & 0 deletions mpas_analysis/shared/io/write_netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ def write_netcdf_with_fill(ds, fileName, fillValues=netCDF4.default_fillvals):
if dtype.type is numpy.bytes_:
encodingDict[variableName] = {'dtype': str}

unlimited_dims = ds.encoding.get('unlimited_dims', None)
if unlimited_dims is not None:
if isinstance(unlimited_dims, str):
unlimited_dims = {unlimited_dims}
unlimited_dims = [dim for dim in unlimited_dims if dim in ds.dims]
ds.encoding['unlimited_dims'] = set(unlimited_dims)
ds.to_netcdf(fileName, encoding=encodingDict)