-
Notifications
You must be signed in to change notification settings - Fork 2
Bugfix: Add missing case for simulations starting after the input data #4
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
==========================================
- Coverage 81.33% 81.28% -0.05%
==========================================
Files 9 9
Lines 1500 1507 +7
==========================================
+ Hits 1220 1225 +5
- Misses 280 282 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 so far, again one small test and rerun the formatting that it should be good to go. Thanks for the rearrangement, that looks much cleaner!
pycoupler/coupler.py
Outdated
cut_start_year = start_year | ||
cut_end = cut_end_year = min(meta_data.lastyear, end_year) | ||
else: | ||
raise ValueError("Unexpected start_year and end_year") |
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.
Can you please add a test here?
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 is actually unreachable and can therefore be removed.
If pycoupler is trying to run a simulation on a dataset that starts before the simulation period, but does contain it, it will fail with:
This is because the case is not covered by the if statement and then
cut_start_year
in no set.This pull requests fixes this and adds further explaining comments.