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 pint: strip, then reattach appropriate units #207

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

dcherian
Copy link
Collaborator

@dcherian dcherian commented Jan 24, 2023

Closes #163

This is the only way until pint adds support for the required numpy methods/ufunc methods

hgrecco/pint#981

@dcherian dcherian requested a review from keewis January 24, 2023 23:50
flox/aggregations.py Outdated Show resolved Hide resolved
@dcherian dcherian removed the request for review from keewis January 25, 2023 03:16
@dcherian dcherian changed the title Pint array: strip and reattach appropriate units Support pint: strip and reattach appropriate units Jan 25, 2023
@dcherian dcherian changed the title Support pint: strip and reattach appropriate units Support pint: strip, then reattach appropriate units Jan 25, 2023
@keewis
Copy link
Contributor

keewis commented Jan 25, 2023

If I understand the page you mentioned correctly, we'd need mostly bincount and the at / reduceat method of the min / max / add / multiply ufuncs.

As far as I can tell, the only reason those are not already implemented is because nobody put in the effort to define them (I'm not sure how tricky supporting at / reduceat through __apply_ufunc__ would be, though).

@dcherian
Copy link
Collaborator Author

the only reason those are not already implemented is because nobody put in the effort to define them

Yes!

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.

Issues when running flox with chunked pint arrays
2 participants