Skip to content

Commit

Permalink
Pass kwargs to xr.open_dataset()
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Oct 19, 2024
1 parent 8127134 commit 76135a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions polaris/ocean/model/ocean_io_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def map_from_native_model_vars(self, ds):
ds = ds.rename(self.omega_to_mpaso_var_map)
return ds

def open_model_dataset(self, filename):
def open_model_dataset(self, filename, **kwargs):
"""
Open the given dataset, mapping variable names from Omega to MPAS-Ocean
names if appropriate
Expand All @@ -128,12 +128,15 @@ def open_model_dataset(self, filename):
filename : str
The path for the NetCDF file to open
kwargs
keyword arguments passed to `xarray.open_dataset()`
Returns
-------
ds : xarray.Dataset
The dataset with variables named as expected in MPAS-Ocean
"""
ds = xr.open_dataset(filename)
ds = xr.open_dataset(filename, **kwargs)
ds = self.map_from_native_model_vars(ds)
return ds

Expand Down

0 comments on commit 76135a5

Please sign in to comment.