Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Aug 13, 2024
1 parent 29e0078 commit d231c3a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions e3sm_to_cmip/mpas.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ def open_mfdataset(
return ds


def write_netcdf(ds, fileName, fillValues=netCDF4.default_fillvals,
unlimited=None):
def write_netcdf(ds, fileName, fillValues=netCDF4.default_fillvals, unlimited=None):
"""Write an xarray Dataset with NetCDF4 fill values where needed"""
encodingDict = {}
variableNames = list(ds.data_vars.keys()) + list(ds.coords.keys())
Expand All @@ -359,8 +358,7 @@ def write_netcdf(ds, fileName, fillValues=netCDF4.default_fillvals,
dtype = ds[variableName].dtype
for fillType in fillValues:
if dtype == np.dtype(fillType):
encodingDict[variableName] = \
{"_FillValue": fillValues[fillType]}
encodingDict[variableName] = {"_FillValue": fillValues[fillType]}
break
else:
encodingDict[variableName] = {"_FillValue": None}
Expand Down

0 comments on commit d231c3a

Please sign in to comment.