Skip to content

(scipy 2022 branch) Add an "options" argument to Index.from_variables() - #6800

Closed
benbovy wants to merge 2 commits into
pydata:scipy22from
benbovy:scipy22
Closed

(scipy 2022 branch) Add an "options" argument to Index.from_variables()#6800
benbovy wants to merge 2 commits into
pydata:scipy22from
benbovy:scipy22

Conversation

@benbovy

Copy link
Copy Markdown
Member

It allows passing options to the constructor of a custom Index subclass, in case there's any relevant build options to expose to users. This could for example be the distance metric chosen for an index based on sklearn.neighbors.BallTree, or the CRS definition for a geospatial index.

The **options arguments of Dataset.set_xindex() are passed through.

An alternative way would be to pass options via coordinate metadata, like the spatial_ref coordinate in rioxarray. Perhaps both alternatives may co-exist?

This PR also adds type annotations to set_xindex().

It allows passing options to the constructor of a custom index class (if
any).
The **options arguments of Dataset.set_xindex() are passed through.
Also add type annotations to set_xindex().
@benbovy

Copy link
Copy Markdown
MemberAuthor

See #6971.

@benbovybenbovy closed this Sep 2, 2022
@benbovy
benbovy deleted the scipy22 branch December 8, 2022 09:38
Sign up for freeto 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.

1 participant

@benbovy