Description
@benbovy, do you have any idea about how to best do this? from_variables is a class method, so it won't preserve any options that were already on the index, even if we don't pass an empty dict. This shouldn't block this PR, though.
Originally posted by @keewis in #163 (comment)
I'm afraid there is no easy way of converting units (i.e, new coordinate values + re-create the underlying index + wrap it as a new
PintIndex
) that would be completely agnostic of the underlying index type.
Actually I would rather drop the index and let the user re-create it manually. This is also better behavior for custom indexes that may be expensive to build (e.g., a KDTree).
For convenience we might also choose to auto-convert indexes for Xarray built-in index types only (and pass the options in a hard-coded way, if any... currently
PandasIndex
andPandasMultiIndex
do not expose any option).
Originally posted by @benbovy in #163 (comment)