-
Notifications
You must be signed in to change notification settings - Fork 7
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
pycln-fix #396
pycln-fix #396
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #396 +/- ##
==========================================
- Coverage 95.44% 95.44% -0.01%
==========================================
Files 46 46
Lines 2942 2940 -2
==========================================
- Hits 2808 2806 -2
Misses 134 134
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -5,7 +5,7 @@ | |||
|
|||
import numpy as np | |||
import pandas as pd | |||
import pint_pandas | |||
import pint_pandas # nopycln: import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remove that import, several tests fail (I suppose every tests that uses this file).
I am not sure why, but I think that it's implicitly using it with
Lines 76 to 82 in 0b72989
self._df = pd.DataFrame( | |
{ | |
"MSR": pd.Series(dtype="pint[V]"), | |
"i": pd.Series(dtype="pint[V]"), | |
"q": pd.Series(dtype="pint[V]"), | |
"phase": pd.Series(dtype="pint[rad]"), | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here our first side effect. Most likely pint_pandas
is patching pandas
(i.e. replacing some content of the module) upon import.
Luckily, we have #372 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this is just how pint works for some reason...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wants to be a drop-in replacement of Pandas, that's the reason. But, yeah, I don't like it so much...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rodolfocarobene
Adding
--all
parameter topycln
.See that I had to add an exception for pint-pandas in data.py, one of the unused/used imports...
Checklist: