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

add_cyclic returns numpy arrays, not xarrays #2342

Open
oliviermarti opened this issue Mar 8, 2024 · 1 comment
Open

add_cyclic returns numpy arrays, not xarrays #2342

oliviermarti opened this issue Mar 8, 2024 · 1 comment

Comments

@oliviermarti
Copy link

Description

cartopy.util.add_cyclic returns numpy arrays, not xarrays.

This is uncomfortable in a lot a cases. For instance one can not use the plot facilities of xarray

In cartopy 0.22.0

Olivier

@rcomer
Copy link
Member

rcomer commented Mar 8, 2024

Cartopy does not know about Xarray so would not have specific support for that. add_cyclic uses slicing and numpy.concatenate so it's possible that if Xarray were to support numpy.concatenate via NEP18 it might just work. I just tried add_cyclic with a dask array (dask supports NEP18) and that seemed to work fine. It would likely be a lot less work to write an Xarray version of add_cyclic outside of Cartopy though.

I'm not sure that there is anything we can do for this on the Cartopy side.

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

No branches or pull requests

2 participants