-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add fast-path to format data #731
Conversation
58e27b0
to
8bd6d4c
Compare
Codecov Report
@@ Coverage Diff @@
## main #731 +/- ##
=======================================
- Coverage 95.0% 95.0% -0.1%
=======================================
Files 59 59
Lines 6020 6037 +17
=======================================
+ Hits 5725 5741 +16
- Misses 295 296 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c841dcb
to
3146714
Compare
0f0e84c
to
a719d53
Compare
Hey @coroa - I hope I didn't clobber your commits here by merging your previous PR first. Could you rebase this one on main and then I can provide a review? Thanks! |
a719d53
to
27d7c2c
Compare
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 this @coroa - I might have a small preference on style (will add suggestion), but not blocking.
Is it possible to add a test for the untested code path?
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.
Looks good to me! If I understand it correctly, the way to access the fast-pass is to set the index before initialization, right?
Indeed. (or even better keep it as it is, ie never reset it :)) |
Co-authored-by: Matthew Gidden <[email protected]>
Black puts it into one line. No haggling. Co-authored-by: Matthew Gidden <[email protected]>
Co-authored-by: Daniel Huppmann <[email protected]>
81b3849
to
ab6b32e
Compare
Rebased to new |
Sorry, my earlier comment was badly phrased... What I meant was the following: In #726, @gidden added an option I think that this is perfectly fine behavior - just wanted to highlight this (or stand corrected if I'm on the wrong track). Fine to merge (and maybe add a "force-fast-pass"-arg later). Thanks! |
You are spot on. The fast-path is not improving file read-in speed (as-is), but only data passing within pyam and pandas, where the index is preserved, like with the |
Co-authored-by: Matthew Gidden [email protected]
Please confirm that this PR has done the following:
Name of contributors Added to AUTHORS.rstDescription in RELEASE_NOTES.md AddedDescription of PR
Add a fast-path to
format_data
for initialization with a multi-index based Series or DataFrame that has all the required columns.I set the base branch for this PR to PR #730 to highlight the small additional changes necessary.