Skip to content

Commit

Permalink
Merge pull request #40 from ocefpaf/strinfy_before_call_lower
Browse files Browse the repository at this point in the history
stringfy before call lower
  • Loading branch information
ocefpaf authored Jul 19, 2018
2 parents 9a72043 + b10fee4 commit b2f31de
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions gridgeo/cfvariable.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ def x_axis(self):
'degree_E',
'degrees_E',
'degreeE',
'degreesE'
'degreesE',
]
xvars = list(set(
self._nc.get_variables_by_attributes(
axis=lambda x: x and x.lower() == 'x'
axis=lambda x: x and str(x).lower() == 'x'
) +
self._nc.get_variables_by_attributes(
standard_name=lambda x: x and x.lower() in xnames
standard_name=lambda x: x and str(x).lower() in xnames
) +
self._nc.get_variables_by_attributes(
units=lambda x: x and x.lower() in xunits
units=lambda x: x and str(x).lower() in xunits
)
))
return self._filter_coords(xvars)
Expand All @@ -104,17 +104,17 @@ def y_axis(self):
'degree_N',
'degrees_N',
'degreeN',
'degreesN'
'degreesN',
]
yvars = list(set(
self._nc.get_variables_by_attributes(
axis=lambda x: x and x.lower() == 'y'
axis=lambda x: x and str(x).lower() == 'y'
) +
self._nc.get_variables_by_attributes(
standard_name=lambda x: x and x.lower() in ynames
standard_name=lambda x: x and str(x).lower() in ynames
) +
self._nc.get_variables_by_attributes(
units=lambda x: x and x.lower() in yunits
units=lambda x: x and str(x).lower() in yunits
)
))
return self._filter_coords(yvars)
Expand All @@ -135,13 +135,13 @@ def z_axis(self):
]
zvars = list(set(
self._nc.get_variables_by_attributes(
axis=lambda x: x and x.lower() == 'z'
axis=lambda x: x and str(x).lower() == 'z'
) +
self._nc.get_variables_by_attributes(
positive=lambda x: x and x.lower() in ['up', 'down']
positive=lambda x: x and str(x).lower() in ['up', 'down']
) +
self._nc.get_variables_by_attributes(
standard_name=lambda x: x and x.lower() in znames
standard_name=lambda x: x and str(x).lower() in znames
)
))
return self._filter_coords(zvars)
Expand Down

0 comments on commit b2f31de

Please sign in to comment.