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

Open loadflow parameters management #151

Merged
merged 4 commits into from
Sep 16, 2020

Conversation

jlabous
Copy link
Contributor

@jlabous jlabous commented Sep 9, 2020

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)

  • 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 ? If so, link to this issue using '#XXX' and skip the rest
#147

@jlabous jlabous requested review from tadam50 and annetill September 9, 2020 09:11
@@ -0,0 +1,62 @@
/**
* Copyright (c) 2019, RTE (http://www.rte-france.com)
Copy link
Contributor

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));
Copy link
Contributor

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()
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete commented code

@jlabous jlabous force-pushed the Open_loadflow_parameters_management branch 3 times, most recently from 4588598 to d8b71fe Compare September 9, 2020 16:10
@annetill annetill requested a review from flo-dup September 11, 2020 11:26
Comment on lines +60 to +62
assertEquals(OpenLoadFlowParameters.BalanceType.PROPORTIONAL_TO_LOAD, olfParameters.getBalanceType());
assertTrue(olfParameters.isDc());
Copy link
Contributor

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

Comment on lines +135 to +143
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)
);
Copy link
Contributor

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?

Copy link
Contributor Author

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,
Copy link
Member

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 ?

Copy link
Contributor Author

@jlabous jlabous Sep 15, 2020

Choose a reason for hiding this comment

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

Rebase on master done

Copy link
Member

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.

@annetill annetill changed the title open loadflow parameters management Open loadflow parameters management Sep 15, 2020
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>
@jlabous jlabous force-pushed the Open_loadflow_parameters_management branch from 3db9008 to 891b010 Compare September 15, 2020 13:54
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

66.7% 66.7% Coverage
0.0% 0.0% Duplication

@annetill annetill merged commit b507861 into master Sep 16, 2020
@annetill annetill deleted the Open_loadflow_parameters_management branch September 16, 2020 06:41
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.

4 participants