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 loadable_variables='coords' option #335

Open
TomNicholas opened this issue Dec 6, 2024 · 2 comments · May be fixed by #353
Open

Add loadable_variables='coords' option #335

TomNicholas opened this issue Dec 6, 2024 · 2 comments · May be fixed by #353
Labels
enhancement New feature or request

Comments

@TomNicholas
Copy link
Member

TomNicholas commented Dec 6, 2024

is there a reason one would not want to always include all coordinates in the loadable_variables

The main reason though is that coordinates can be N-dimensional in general, in which case you might use a lot of storage duplicating them. But for low-dimensional coordinates I agree we should recommend people load them.

Perhaps we should even add another option: loadable_variables='coords' or loadable_variables='1d_coords', which we could default to... The latter is pretty much what xr.open_dataset already does for choosing which coordinates to create indexes for.

Originally posted by @TomNicholas in #330

@TomNicholas TomNicholas added enhancement New feature or request good first issue Good for newcomers labels Dec 6, 2024
@TomNicholas
Copy link
Member Author

In fact if we do this then why not just change the default for indexes too, or even get rid of it entirely. Loading 1D coordinates and creating indexes, but keeping 2+D coordinates virtual and not trying to create indexes for them (which I don't think is even possible in xarray right now anyway) would be much more intuitive and sane default behaviour, and it would mean all our examples don't need the indexes={} kwarg in them anymore.

In other words we want the default behaviour to be the same as xarray except that data variables and multi-dimensional coordinate variables are virtual. I think I was just over-complicating things.

@TomNicholas TomNicholas removed the good first issue Good for newcomers label Dec 8, 2024
@TomNicholas
Copy link
Member Author

In #353 I added the options, but making them work with the indexes kwarg for all possible cases is a lot of effort for basically no gain as far as I can tell. I think I will just remove indexes entirely.

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

Successfully merging a pull request may close this issue.

1 participant