Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code for writing netCDF unlimited dimensions #267

Merged
merged 2 commits into from
Aug 30, 2023
Merged
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
11 changes: 5 additions & 6 deletions cfdm/read_write/netcdf/netcdfwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,7 @@ def _write_dimension_coordinate(self, f, key, coord, ncdim, coordinates):
ncdim = ncvar

# Create a new dimension
unlimited = self.implementation.nc_is_unlimited_axis(f, axis)

unlimited = self._unlimited(f, axis)
self._write_dimension(ncdim, f, axis, unlimited=unlimited)

ncdimensions = self._netcdf_dimensions(f, key, coord)
Expand Down Expand Up @@ -3547,9 +3546,7 @@ def _write_field_or_domain(

ncdim = self._netcdf_name(ncdim)

unlimited = self.implementation.nc_is_unlimited_axis(
f, axis
)
unlimited = self._unlimited(f, axis)
self._write_dimension(
ncdim, f, axis, unlimited=unlimited
)
Expand Down Expand Up @@ -4123,9 +4120,11 @@ def _unlimited(self, field, axis):

:Parameters:

field: Field construct
field: `Field` or `Domain`

axis: `str`
Domain axis construct identifier,
e.g. ``'domainaxis1'``.

:Returns:

Expand Down
Loading