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

AutoGlskProvider uses connected generators, and don't crash when the sum of target Ps is zero #131

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

gverger
Copy link
Member

@gverger gverger commented Jan 12, 2024

Take only connected generators into account for the AutoGlskProvider.

If the sum of targetPs of a country equals 0.0, all generators take an equal part into the total value. This prevents dividing by 0.

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
The AutoGlskProvider takes into consideration connected generators only.
It also fixes a bug (dividing by 0) when the generators have a target P equal to 0.

Take only connected generators into account for the AutoGlskProvider.

If the sum of targetPs of a country equals 0.0, all generators take an
equal part into the total value. This prevents dividing by 0.

Signed-off-by: Guillaume Verger <guillaume.verger@artelys.com>
@gverger gverger requested a review from phiedw January 18, 2024 15:30
Copy link
Contributor

@OpenSuze OpenSuze left a comment

Choose a reason for hiding this comment

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

Thank you for this PR !

Signed-off-by: Guillaume Verger <guillaume.verger@artelys.com>
Copy link

sonarcloud bot commented Jan 19, 2024

@phiedw phiedw merged commit 9e9be3c into main Jan 29, 2024
6 checks passed
@phiedw phiedw deleted the feature/autoglsk-defaults branch January 29, 2024 10:07
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