-
Notifications
You must be signed in to change notification settings - Fork 122
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 an option to skip existing intermediate variables when aggregating recursivly #532
Add an option to skip existing intermediate variables when aggregating recursivly #532
Conversation
Codecov Report
@@ Coverage Diff @@
## main #532 +/- ##
=====================================
Coverage 93.5% 93.5%
=====================================
Files 47 48 +1
Lines 5228 5257 +29
=====================================
+ Hits 4891 4920 +29
Misses 337 337
Continue to review full report at Codecov.
|
I don't understand why stickler-ci is failing as it doesn't tell me the line where the PR differs from the black code style |
You can directly commit my suggestion to your branch directly, this should appease Stickler. Going forward, I recommend that you install a Black linter utility on your machine and follow this workflow:
After a while, you'll not need to run the linter anymore because you'll be coding black naturally... |
Co-authored-by: Daniel Huppmann <dh@dergelbesalon.at>
thanks, that did the job :) |
Looking at the code implementation in a bit more detail, two thoughts:
|
I changed the implementation from comparing variables beforehand to comparing indices after aggregating, which should now be able to deal with different variable sets in different scenarios, regions or even years. Concerning your first thought: I'd prefer to not check internal consistency while skipping intermediate variables but rather let the user check it afterwards. When explicitly using this feature it should be clear that the intermediate variables are not aggregated by pyam and should be checked. Running |
It seems like stickler uses slightly different definitions of black than the built-in black-linter in Spyder. |
Thanks for continuing to work on this, sorry for the issues with difference versions of black... Re your comment:
There is a tradeoff here:
And either way, first running recursive-aggregation and the checking consistency is not an efficient approach, because it requires computing a lot of data twice. So let me modify my earlier suggestion:
Later extensions could then also do something like |
I implemented my approach for the aggregation check. I will change the interface with dropping the |
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.
Just one minor in-line comment for now - will need to check the approach more thoroughly later...
Co-authored-by: Daniel Huppmann <dh@dergelbesalon.at>
Refactor implementation for (skipping) validation
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 @pjuergens for the initiative!
Please confirm that this PR has done the following:
Description of PR
Add an option to skip existing intermediate variables when aggregating recursivly as discussed in #525