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

Support for set_xindex? #218

Open
vasilisniaouris opened this issue May 18, 2023 · 1 comment · May be fixed by #163
Open

Support for set_xindex? #218

vasilisniaouris opened this issue May 18, 2023 · 1 comment · May be fixed by #163

Comments

@vasilisniaouris
Copy link

vasilisniaouris commented May 18, 2023

The set_xindex methods of DataArray and Dataset drop the units. Is there a way to add a pint.set_xindex functionality?

Edit:

I realized that I can not seem to initialize a dataarray with Quantity objects as dimensions to begin with. The dimensions objects always drop the units. I tried to create a pint set_xindex myself, but that was the bottleneck I run into. Am I doing something wrong, or quantity Indexes are indeed not supported in general?

@keewis
Copy link
Collaborator

keewis commented Jun 14, 2023

sorry for the late reply here. As you noticed, quantity indexes are not yet supported in general, which is why we have workaround methods like .pint.sel and .pint.reindex.

I have tried to create a class that wraps other indexes in #163, but couldn't find the time to finish this up yet (so I guess this has stalled).

I also didn't yet figure out how you would use that special index class, so even if it was working I guess you'd have to call set_xindex before quantifying.

@keewis keewis linked a pull request Dec 10, 2023 that will close this issue
5 tasks
@keewis keewis linked a pull request Dec 10, 2023 that will close this issue
5 tasks
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 a pull request may close this issue.

2 participants