-
Notifications
You must be signed in to change notification settings - Fork 416
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
Masked arrays break wind_direction
function
#1390
Labels
Milestone
Comments
I'm not sure why the other one works. If a boolean operation like that returns all mask = wdir <= 0
if np.any(mask):
wdir[mask] += ... Wanna submit a PR to fix this? |
rpmanser
added a commit
to rpmanser/MetPy
that referenced
this issue
Jul 14, 2020
2 tasks
rpmanser
added a commit
to rpmanser/MetPy
that referenced
this issue
Jul 28, 2020
dopplershift
added a commit
that referenced
this issue
Jul 28, 2020
Fix masked arrays breaking wind_direction #1390
dopplershift
pushed a commit
to dopplershift/MetPy
that referenced
this issue
Aug 5, 2020
dopplershift
pushed a commit
to dopplershift/MetPy
that referenced
this issue
Aug 5, 2020
dopplershift
pushed a commit
to dopplershift/MetPy
that referenced
this issue
Aug 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Masked arrays break the
wind_direction
function when all calculated directions are greater than 0 degrees.Which results in the following error:
ValueError: can only convert an array of size 1 to a Python scalar
at this line of the function:
which only occurs when all values in wdir are greater than 0.
The traceback goes through the pint and numpy masked array libraries, so this may be an upstream problem. If different units are specified and a similar operation is performed, things work as expected. For example,
works just fine.
A temporary work around could involve just checking if the magnitude of wdir is a masked array.
Linux Mint 18.3 Sylvia
MetPy version 1.0.0
NumPy version 1.18.4
The text was updated successfully, but these errors were encountered: