Skip to content
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: correct bug with carried-over gencosts for new plants #407

Merged
merged 3 commits into from
Feb 25, 2021

Conversation

danielolsen
Copy link
Contributor

Purpose

Fix the bug, where new renewable generators added after a thermal generator inherit the thermal generator's cost curve coefficients.

What the code is doing

The first commit reproduces the code in a test, the second commit fixes it by ensuring that no values are carried over.

Time estimate

1 minute.

@danielolsen danielolsen self-assigned this Feb 25, 2021
Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@rouille
Copy link
Collaborator

rouille commented Feb 25, 2021

Should we move in the for loop the other too (new_branch, new_plant, etc.)? I mean we need to set the value of the columns to 0 for all of them in principle.

@danielolsen
Copy link
Contributor Author

Should we move in the for loop the other too (new_branch, new_plant, etc.)? I mean we need to set the value of the columns to 0 for all of them in principle.

The problem that is specific to gencost is the if block which updates those entries only sometimes. It should not be a problem for the other loops which do not have this feature, but it is probably good practice to move them all, to avoid this issue potentially arising later.

@danielolsen
Copy link
Contributor Author

The analogous line has been moved inside the loops in the other add methods.

Copy link
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@danielolsen danielolsen force-pushed the daniel/gencost_bugfix branch from 7ca1891 to 9c257e7 Compare February 25, 2021 22:18
@danielolsen danielolsen merged commit 98dce15 into develop Feb 25, 2021
@danielolsen danielolsen deleted the daniel/gencost_bugfix branch February 25, 2021 22:25
@ahurli ahurli mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants