Skip to content

Add NDPointIndex (KDTree) #10478

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,7 @@ Custom Indexes
CFTimeIndex
indexes.RangeIndex
indexes.CoordinateTransformIndex
indexes.NDPointIndex

Creating custom indexes
-----------------------
Expand Down
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ New Features

- Expose :py:class:`~xarray.indexes.RangeIndex`, and :py:class:`~xarray.indexes.CoordinateTransformIndex` as public api
under the ``xarray.indexes`` namespace. By `Deepak Cherian <https://github.com/dcherian>`_.
- New :py:class:`xarray.indexes.NDPointIndex`, which by default uses :py:class:`scipy.spatial.KDTree` under the hood for
the selection of irregular, n-dimensional data (:pull:`10478`).
By `Benoit Bovy <https://github.com/benbovy>`_.
- Support zarr-python's new ``.supports_consolidated_metadata`` store property (:pull:`10457``).
by `Tom Nicholas <https://github.com/TomNicholas>`_.
- Better error messages when encoding data to be written to disk fails (:pull:`10464`).
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/coordinate_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def equals(self, other: CoordinateTransform, **kwargs) -> bool:
Parameters
----------
other : CoordinateTransform
The other Index object to compare with this object.
The other CoordinateTransform object to compare with this object.
exclude : frozenset of hashable, optional
Dimensions excluded from checking. It is None by default, (i.e.,
when this method is not called in the context of alignment). For a
Expand Down
2 changes: 2 additions & 0 deletions xarray/indexes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
PandasIndex,
PandasMultiIndex,
)
from xarray.indexes.nd_point_index import NDPointIndex
from xarray.indexes.range_index import RangeIndex

__all__ = [
"CoordinateTransform",
"CoordinateTransformIndex",
"Index",
"NDPointIndex",
"PandasIndex",
"PandasMultiIndex",
"RangeIndex",
Expand Down
Loading
Loading