Skip to content

Add NDPointIndex examples #25

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

Merged
merged 6 commits into from
Jul 9, 2025

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Jul 9, 2025

  • Simple example (using scipy's KDTree)
  • Advanced example based on ROMS data (using custom adapter based on scikit-learn's BallTree) (wip)

@dcherian
Copy link
Contributor

dcherian commented Jul 9, 2025

How about we put the default KDTree example under "Builtin" with title "KDTree with NDPointIndex" and leave the advanced example for this "Building Blocks" page

@benbovy
Copy link
Member Author

benbovy commented Jul 9, 2025

How about we put the default KDTree example under "Builtin" with title "KDTree with NDPointIndex" and leave the advanced example for this "Building Blocks" page.

Or some "3rd-party extensible" visual marker, e.g., in the detailed TOC?

It is nice to keep short each section but at the same time too much breaking down might make things hardly discoverable.

Like @scottyhq (#17 (comment)) I think that built-in and building block categories could be merged together (CoordinateTransformIndex can also be used as-is, especially if we later provide some built-in transforms). But I also think that is is important to be able to identify which indexes are building blocks.

@benbovy
Copy link
Member Author

benbovy commented Jul 9, 2025

Aouch pydata/xarray#10503 broke the xdggs example.

@dcherian
Copy link
Contributor

dcherian commented Jul 9, 2025

But I also think that is is important to be able to identify which indexes are building blocks.

that was my initial thinking.

Aouch pydata/xarray#10503 broke the xdggs example.

ouch indeed, I can revert in an hour or I can merge if someone else sends up the revert PR.

cc @keewis

@benbovy
Copy link
Member Author

benbovy commented Jul 9, 2025

Tried pydata/xarray#10518 but it created other problems.

A working fix would be in xdggs to rename the wrapped pandas Index after creating the xarray index in xdggs.DGGSIndex.from_variables (and/or in each DGGS index subclass) , like it is done in xarray.indexes.PandasIndex.from_variables.

@dcherian
Copy link
Contributor

dcherian commented Jul 9, 2025

So... how did this get fixed?

I have seen the light.

@dcherian
Copy link
Contributor

dcherian commented Jul 9, 2025

Amazing work, @benbovy I pushed a minor edit (mostly a new image to make it easier to present), and will merge now.

Thanks for pushing hard here this week. I think this gallery is now an impressive testament to what you've accomplished!

@dcherian dcherian enabled auto-merge (squash) July 9, 2025 20:19
@dcherian dcherian merged commit 747d3d2 into xarray-contrib:main Jul 9, 2025
2 checks passed
@benbovy benbovy deleted the add-nd-point-index branch July 10, 2025 08:20
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.

3 participants