Skip to content

Commit

Permalink
Merge pull request #1206 from jthielen/issue-1203-xarray-coord
Browse files Browse the repository at this point in the history
Quick fix for test_narr_example_variable_without_grid_mapping test (broken by xarray v0.14)
  • Loading branch information
dopplershift committed Oct 16, 2019
2 parents ce82267 + 143c05b commit e3137a9
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit e3137a9

Please sign in to comment.