Skip to content

Commit

Permalink
apply suggestion from review
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal committed Feb 24, 2021
1 parent fcbb739 commit 638b38d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cf_xarray/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ def _get_with_standard_name(

varnames = []
if isinstance(obj, DataArray):
obj = obj._to_temp_dataset()
obj = obj.coords.to_dataset()
for vname, var in obj.variables.items():
stdname = var.attrs.get("standard_name", None)
if stdname == name and vname != xr.core.dataarray._THIS_ARRAY:
if stdname == name:
varnames.append(str(vname))

return varnames
Expand Down

0 comments on commit 638b38d

Please sign in to comment.