Skip to content

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

Closed
raybellwaves wants to merge 4 commits into
Unidata:mainfrom
raybellwaves:angle_to_direction-return-xrdataarray
Closed

return xr.DataArray for angle_to_direction if input is xr.DataArray#3463
raybellwaves wants to merge 4 commits into
Unidata:mainfrom
raybellwaves:angle_to_direction-return-xrdataarray

Conversation

@raybellwaves

Copy link
Copy Markdown
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
Comment thread src/metpy/calc/tools.py Fixed
Comment thread src/metpy/calc/tools.py Fixed
@raybellwaves

Copy link
Copy Markdown
Contributor Author

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

@raybellwaves

raybellwaves commented Apr 3, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

happy with this. Nice work on @preprocess_and_wrap

@raybellwaves

Copy link
Copy Markdown
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.

2 participants