-
Notifications
You must be signed in to change notification settings - Fork 267
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
fix: the planning_horizons params in CCL need to be string #1551
Conversation
@FabianHofmann It looks like you added a bit of confusion around the All functions as far as i can see from a quick skim were only using the
The doc-string you added to A solution would be as proposed here to update the params definition, but i'd let you want to make the call on how to disentangle it. :) |
And @yechenyan thanks for the PR in either case. |
lovely, I knew something would come and haunt me (but to my defense it is confusing with wildcards.planning_horizons being plural and having the same name as used in params...). anyway, I am fine with this fix here if that works. @yechenyan thanks for covering. would you mind fixing the docstring as well? |
I've made the changes and fixed the docstring. @FabianHofmann |
Awesome, after the ci runs through, we can merge |
I do not think that Can you please then also update the doc strings in the function that for perfect foresight a list of planning horizons is passed? Could also be done as a separate PR, i guess. |
When using perfect forecasts, there is no Before Consistent function scope 1537 PR, if Of course, passing in the If needed, I will submit another PR to handle the perfect forecasts. |
I think the alternative over in #1560, that i built ontop (so your contributions are counted, @yechenyan ). is more correct, by abolishing the param and using the wildcard consistently instead or None where it is not available. That should give us back what was there before #1537 |
Closes # (if applicable).
Issue:
When using CCL, an error occurs because the year key cannot be found in
agg_p_nom_minmax.csv
. The error is shown in the image below.config:
agg_p_nom_minmax.csv:
Cause:
The issue arises in the function
add_CCL_constraints
https://github.com/PyPSA/pypsa-eur/blob/master/scripts/solve_network.py#L984.The parameter
planning_horizons
should be a string, but a list is passed instead.This problem was introduced by the changes in the PR for Consistent function scope
1537 (#1537).
Solution:
Modify the definition of the
planning_horizons
parameter in the rule to be a string.Changes proposed in this Pull Request
Checklist
envs/environment.yaml
.config/config.default.yaml
.doc/configtables/*.csv
.doc/data_sources.rst
.doc/release_notes.rst
is added.