-
Notifications
You must be signed in to change notification settings - Fork 159
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
Ensure compatibility with pandas CoW #842
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #842 +/- ##
=======================================
+ Coverage 95.4% 95.6% +0.1%
=======================================
Files 46 46
Lines 4354 4339 -15
=======================================
- Hits 4156 4149 -7
+ Misses 198 190 -8
|
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.
So long as CI passes, we are good to go.
I made some inline comments that maybe would be irrelevant if #494 will refactor the affected code, so they are just FYI.
else: | ||
df = df.reset_index().copy() | ||
df = ( | ||
df.reset_index().loc[df.reset_index()[level].isin(locator)].copy() |
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.
#494 was intended to pick up and improve many of these usages. Here, I suspect .xs()
could be used. No need to actually make that change in this PR, just noting for later reference.
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 for the note :)
42fb3a3
to
6655e45
Compare
Not sure why codecov/patch registers a diff hit, we test the same functions as before. So I'm fine with the hit if that comes from additional lines that reduce complexity. I'll rebase to exclude the |
6655e45
to
d7a4ff4
Compare
* Clean up code, reducing complexity * Add lots of type hints * Break some tests
d7a4ff4
to
4913c24
Compare
Closes #804.
This PR temporarily enables the pandas Copy-on-Write behaviour that will become standard with pandas 3.0. With this, I ran all tests locally to study the warnings we would get from this: only two files were affected,
add_year/__init__
andmacro
. Then, I fixed all of these warnings as suggested in the migration guide, so we might be good with this repo (and all underlying ixmp functions called from the test suite here) :)How to review
TEMPORARY
commit to avoid enabling pandas CoW for all users already.PR checklist
[ ] Add or expand tests; coverage checks both ✅[ ] Add, expand, or update documentation.