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

return xr.DataArray for angle_to_direction if input is xr.DataArray #3463

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

raybellwaves
Copy link
Contributor

Description Of Changes

return xr.DataArray for angle_to_direction if input is xr.DataArray

Checklist

  • Closes #xxxx
  • Tests added
  • Fully documented

@raybellwaves raybellwaves requested a review from a team as a code owner April 2, 2024 21:07
@raybellwaves raybellwaves requested review from dopplershift and removed request for a team April 2, 2024 21:07
src/metpy/calc/tools.py Fixed Show fixed Hide fixed
src/metpy/calc/tools.py Fixed Show fixed Hide fixed
@raybellwaves
Copy link
Contributor Author

Was hoping it would work out of the box. No idea why it's outputting "N" instead of "W"

@raybellwaves
Copy link
Contributor Author

raybellwaves commented Apr 3, 2024

ah think I found it the xarray objects get assigns units "dimensionless" early on

preprocess_and_wrap casts the input to a numpy array and because it's an xarray object it gets assigns units of dimensionless

@raybellwaves
Copy link
Contributor Author

happy with this. Nice work on @preprocess_and_wrap

@raybellwaves
Copy link
Contributor Author

nvm. Bit too much whack-a-mole getting it work for xarray then to have it failing for the scalar and list test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant