You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of xarray's roadmap is to elevate indexes to be an explicit part of their data model. The task is discussed here and there's an overview of the project here. This would allow users to index their arrays with custom index classes, rather than being forced to use pandas.Index.
This is relevant to pint-xarray integration because it would mean we could do unit-aware label-based indexing, i.e.
da.sel(x=10*Unit('m'))
At the moment that won't work because the indexers get coerced to pandas.Index internally within xarray, which isn't unit-aware.
To get this working we probably need to create our own custom index class, an IndexQuantity. While the default implementation would either wrap or subclass pandas.index, we should also consider how to write it in such a way that alternative indexers could be wrapped, such as periodic indexers or cKDtree indexers.
The text was updated successfully, but these errors were encountered:
Part of xarray's roadmap is to elevate indexes to be an explicit part of their data model. The task is discussed here and there's an overview of the project here. This would allow users to index their arrays with custom index classes, rather than being forced to use
pandas.Index
.This is relevant to pint-xarray integration because it would mean we could do unit-aware label-based indexing, i.e.
At the moment that won't work because the indexers get coerced to
pandas.Index
internally within xarray, which isn't unit-aware.To get this working we probably need to create our own custom index class, an
IndexQuantity
. While the default implementation would either wrap or subclasspandas.index
, we should also consider how to write it in such a way that alternative indexers could be wrapped, such as periodic indexers or cKDtree indexers.The text was updated successfully, but these errors were encountered: