xarray-tutorial icon indicating copy to clipboard operation
xarray-tutorial copied to clipboard

Custom index tutorial

Open e-marshall opened this issue 1 year ago β€’ 3 comments

This PR would add a notebook demonstrating how to build a custom index to the tutorial. It is loosely based on the how to create a custom index page (which was very helpful in writing this) but is aimed to be a bit more explanatory. it has the following structure:

  • a bit of background and introduce the motivation for using custom indexes
  • build a custom index for a simplified case of a 1d dataset where we'd like an index to handle a coordinate transform Steps to build index:
  • build skeleton index with just from_variables()
  • add create_variables(), sel() and transform
  • add equals(), join() and reindex_like() to support alignment

If folks think this would be a worthwhile addition to the tutorial, I'd love to keep working on this and to incorporate any feedback and suggestions

e-marshall avatar Aug 19 '24 22:08 e-marshall

Check out this pull request onΒ  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

🎊 PR Preview 131d71506670ac25b1db5916b209052d0f13c614 has been successfully built and deployed to https://xarray-contrib-xarray-tutorial-preview-pr-295.surge.sh

πŸ• Build time: 0.013s

πŸ€– By surge-preview

github-actions[bot] avatar Aug 19 '24 22:08 github-actions[bot]

If folks think this would be a worthwhile addition to the tutorial, I'd love to keep working on this and to incorporate any feedback and suggestions

Absolutely this would be a great addition @e-marshall!

scottyhq avatar Sep 10 '24 06:09 scottyhq

Just noting that a lot of development on Xarray indexing has happened over the last year in particular this new webpage of examples is coming together https://github.com/xarray-contrib/xarray-indexes !

Eventually we should review content to make sure not too much is duplicated across Xarray docs, Xarray tutorial, and external resources like the one above, but that they also link to eachother.

scottyhq avatar Jul 07 '25 12:07 scottyhq

I think that one should be merged in with some kind of gallery that should also include the ecosystem book in this repo. I created a new one so we could iterate quickly

dcherian avatar Jul 07 '25 12:07 dcherian