xarray
xarray copied to clipboard
(scipy 2022 branch) Add an "options" argument to Index.from_variables()
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().