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

Parse_angle only takes single str or list #1150

Closed
zbruick opened this issue Sep 10, 2019 · 0 comments · Fixed by #1152
Closed

Parse_angle only takes single str or list #1150

zbruick opened this issue Sep 10, 2019 · 0 comments · Fixed by #1152
Labels
Area: Calc Pertains to calculations Type: Bug Something is not working like it should
Milestone

Comments

@zbruick
Copy link
Contributor

zbruick commented Sep 10, 2019

In trying to use metpy.calc.parse_angle with some Mesonet data, I came across the issue that anything other than a single string or a list cannot be passed in, even though it says "array-like". Theoretically this should accept an array or pandas.Series easily.

Looking at the code, it's obvious why this breaks, as the only two types explicitly allowed are strings and lists.

import pandas as pd
import metpy.calc as mpcalc

data = pd.read_csv('../Downloads/current.csv.txt', na_values=' ')
data = data.dropna(subset=['TAIR', 'TDEW', 'WDIR', 'WSPD'])
wind_direction = data['WDIR']
# Works
mpcalc.parse_angle(list(wind_direction))
# Doesn't work
mpcalc.parse_angle(wind_direction)
  • python: 3.7.3
  • metpy: master
@zbruick zbruick added Type: Bug Something is not working like it should Area: Calc Pertains to calculations labels Sep 10, 2019
@dopplershift dopplershift added this to the 0.11 milestone Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants