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

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

Closed
wants to merge 2 commits into from

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Jul 17, 2022

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
Member Author

benbovy commented Sep 2, 2022

See #6971.

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

1 participant