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

Workaround pintpandas iter issue #1125

Closed
wants to merge 6 commits into from

Conversation

andrewgsavage
Copy link
Collaborator

  • Closes # (insert issue number)
  • Executed black -t py36 . && isort -rc . && flake8 with no errors
  • The change is fully covered by automated unit tests
  • Documented in docs/ as appropriate
  • Added an entry to the CHANGES file

Possible work around for the iter issue
Drops the failing tests from
====== 21 failed, 329 passed, 29 xfailed, 2 xpassed, 6 warnings in 21.44s ======
to
====== 4 failed, 346 passed, 28 xfailed, 3 xpassed, 11 warnings in 17.55s ======

hgrecco/pint-pandas#33
see also
#753

@znicholls
Copy link
Contributor

Super nice @andrewgsavage !

@hgrecco
Copy link
Owner

hgrecco commented Jul 1, 2020

awesome

@hgrecco
Copy link
Owner

hgrecco commented Jul 1, 2020

There are a few failing tests.

@znicholls
Copy link
Contributor

There are a few failing tests

One thing I noticed, we'll need a hack to workaround e.g. Quantity("1", "m") because strings are iterable :(

@andrewgsavage
Copy link
Collaborator Author

(Tiny typo) magnitide —> magnitude
haha ty, didn't notice that when debugging and was confused

OK sounds like you're happy with this approach, will try to get this working.

@hgrecco
Copy link
Owner

hgrecco commented Jul 1, 2020

I have to say that I was surprised that it worked. A few years ago I tried doing this with the __str__ method but it did not work. But I think that __iter__ is different.

Can you also try in this PR to change the imports from pintpandas to pint_pandas (I posted the change here hgrecco/pint-pandas#1)

Not required any more, done in #1127

@hgrecco
Copy link
Owner

hgrecco commented Jul 1, 2020

I was trying to fix the pending issues without success. Likely because Magic methods like iter are looked up on the class, not the instance as described here. I will release pint-pandas and then maybe we should rediscuss if we create a Quantity class that inherits from numpy array.

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.

3 participants