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

Explore usage of xarray.Coordinates #51

Open
martinfleis opened this issue Aug 21, 2023 · 1 comment
Open

Explore usage of xarray.Coordinates #51

martinfleis opened this issue Aug 21, 2023 · 1 comment

Comments

@martinfleis
Copy link
Member

I remember that when writing some pieces of our code, I would have welcome xarray.Coordinates object. Now that it is available, we should explore whether it could simplify some bits of our code.

@benbovy
Copy link
Member

benbovy commented Aug 28, 2023

xarray.Coordinates is mostly useful as an intermediate object to pass to a Dataset or DataArray (either via their __init__ or assign_coords method), for example if one wants Xarray 1-d dimension coordinates with no default index or coordinates created from an existing (non-Xarray) index object (like Coordinates.from_pandas_multiindex).

Here I'm not sure if building indexed coordinates from an existing shapely.STRtree object would be a common case? We also have Dataset.xvec.set_geom_indexes that replaces existing indexes, if any.

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