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

Update netcdf.py #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions intake_xarray/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _open_dataset(self):

if "*" in url or isinstance(url, list):
_open_dataset = xr.open_mfdataset
if self.pattern:
if self.path_as_pattern:
kwargs.update(preprocess=self._add_path_to_ds)
if self.combine is not None:
if 'combine' in kwargs:
Expand All @@ -95,5 +95,5 @@ def _add_path_to_ds(self, ds):
"""Adding path info to a coord for a particular file
"""
var = next(var for var in ds)
new_coords = reverse_format(self.pattern, ds[var].encoding['source'])
new_coords = reverse_format(self.path_as_pattern, ds[var].encoding['source'])
return ds.assign_coords(**new_coords)