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

Remove __array__ interface #1778

Closed
wants to merge 4 commits into from

Conversation

coroa
Copy link
Contributor

@coroa coroa commented May 13, 2023

In hunting down options to address hgrecco/pint-pandas#174 , the only solution i found so far to reliably work was to get rid of the __array__ interface entirely, as a more extreme version of the discussion in #1128 .

I was quite surprised to learn that nothing in pint directly depends on the interface, but i guess it would be too much of a breaking change. Nevertheless, I like the idea of pint not ever implictly stripping units.

More realistically this means a proper implementation of the __array_ufunc__ alternative might solve at least the linked issue.

I guess you all are exhausted by these discussion already, sorry that i am pbb missing all the basics.

@andrewgsavage
Copy link
Collaborator

This is interesting, the main issues we've had previously was due to a pint scalar Q(1,"m") being treated as iterable since it has a iter method, which pandas looked for to determine whether an object was array like. The iter would fail, but pandas was checking whether it exsists not whether it fails.

This is interesting as you've removed array not iter.

@andrewgsavage
Copy link
Collaborator

can close this since reductions now work for pint-pandas

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.

None yet

2 participants