-
Notifications
You must be signed in to change notification settings - Fork 8
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
Open loadflow parameters management #151
Conversation
@@ -0,0 +1,62 @@ | |||
/** | |||
* Copyright (c) 2019, RTE (http://www.rte-france.com) |
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.
Replace 2019 by 2020
|
||
platformConfig.getOptionalModuleConfig("open-loadflow-default-parameters") | ||
.ifPresent(config -> { | ||
parameters.setBalanceType(config.getEnumProperty("balanceType", BalanceType.class, BalanceType.PROPORTIONAL_TO_GENERATION_P_MAX)); |
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.
Maybe we could add a new class util/ParameterConstants.java in order to group all parameter name as :
balanceType, dc, distributedSlack, ...
parameters.setDc(config.getBooleanProperty("dc", false)); | ||
parameters.setDistributedSlack(config.getBooleanProperty("distributedSlack", true)); | ||
parameters.setLowImpedanceBranchMode(config.getEnumProperty("lowImpedanceBranchMode", LowImpedanceBranchMode.class, LowImpedanceBranchMode.REPLACE_BY_ZERO_IMPEDANCE_LINE)); | ||
// p arameters.setSlackBusSelector() |
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.
Delete commented code
4588598
to
d8b71fe
Compare
assertEquals(OpenLoadFlowParameters.BalanceType.PROPORTIONAL_TO_LOAD, olfParameters.getBalanceType()); | ||
assertTrue(olfParameters.isDc()); |
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.
Add test for the 4 other parameters
src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
parameters.setBalanceType(config.getEnumProperty(BALANCE_TYPE_PARAM_NAME, BalanceType.class, BALANCE_TYPE_DEFAULT_VALUE)); | ||
parameters.setDc(config.getBooleanProperty(DC_PARAM_NAME, DC_DEFAULT_VALUE)); | ||
parameters.setDistributedSlack(config.getBooleanProperty(DISTRIBUTED_SLACK_PARAM_NAME, DISTRIBUTED_SLACK_DEFAULT_VALUE)); | ||
parameters.setLowImpedanceBranchMode(config.getEnumProperty(LOW_IMPEDANCE_BRANCH_MODE_PARAM_NAME, LowImpedanceBranchMode.class, LOW_IMPEDANCE_BRANCH_MODE_DEFAULT_VALUE)); | ||
parameters.setVoltageRemoteControl(config.getBooleanProperty(VOLTAGE_REMOTE_CONTROLE_PARAM_NAME, VOLTAGE_REMOTE_CONTROLE_DEFAULT_VALUE)); | ||
parameters.setThrowsExceptionInCaseOfSlackDistributionFailure( | ||
config.getBooleanProperty(THROWS_EXCEPTION_IN_CASE_OF_SLACK_DISTRIBUTION_FAILURE_PARAM_NAME, THROWS_EXCEPTION_IN_CASE_OF_SLACK_DISTRIBUTION_FAILURE_DEFAULT_VALUE) | ||
); |
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.
I'm wondering why thoses lines are considered uncovered by the test, any ideas what we're missing?
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 might be possible that sonar could not trace the cal that go througth configLoader in an other package
|
||
private BalanceType balanceType = BalanceType.PROPORTIONAL_TO_GENERATION_P_MAX; // Default slack distribution on generators. | ||
private LowImpedanceBranchMode lowImpedanceBranchMode = LOW_IMPEDANCE_BRANCH_MODE_DEFAULT_VALUE; | ||
|
||
public enum BalanceType { | ||
PROPORTIONAL_TO_GENERATION_P, // Not implemented yet. | ||
PROPORTIONAL_TO_GENERATION_P_MAX, | ||
PROPORTIONAL_TO_LOAD, |
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 add PROPORTIONAL_TO_CONFORM_LOAD
?
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.
Rebase on master done
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 implemented indeed, see in the master branch. The issue is partly implemented.
Signed-off-by: Jérémy LABOUS <jlabous@silicom.fr>
Signed-off-by: Jérémy LABOUS <jlabous@silicom.fr>
Signed-off-by: Jérémy LABOUS <jlabous@silicom.fr>
3db9008
to
891b010
Compare
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
SonarCloud Quality Gate failed. 0 Bugs |
Signed-off-by: Jérémy LABOUS jlabous@silicom.fr
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the rest#147