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

Quick fix for test_narr_example_variable_without_grid_mapping test (broken by xarray v0.14) #1206

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/metpy/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,10 @@ def parse_cf(self, varname=None, coordinates=None):
from .plots.mapping import CFProjection

if varname is None:
# If no varname is given, parse the entire dataset
return self._dataset.apply(lambda da: self.parse_cf(da.name,
coordinates=coordinates),
keep_attrs=True)
elif iterable(varname) and not is_string_like(varname):
# If no varname is given, parse all variables in the dataset
varname = list(self._dataset.data_vars)

if iterable(varname) and not is_string_like(varname):
# If non-string iterable is given, apply recursively across the varnames
subset = xr.merge([self.parse_cf(single_varname, coordinates=coordinates)
for single_varname in varname])
Expand Down