Skip to content

Commit

Permalink
Merge pull request #267 from davidhassell/netcdf-unlimited-dimension
Browse files Browse the repository at this point in the history
Refactor code for writing netCDF unlimited dimensions
  • Loading branch information
davidhassell authored Aug 30, 2023
2 parents e13ec51 + 14f77a9 commit be9af6b
Showing 1 changed file with 5 additions and 6 deletions.
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

0 comments on commit be9af6b

Please sign in to comment.