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

Refacto parameters #736

Merged
merged 28 commits into from
Mar 8, 2023
Merged

Refacto parameters #736

merged 28 commits into from
Mar 8, 2023

Conversation

Godelaine
Copy link
Collaborator

@Godelaine Godelaine commented Feb 24, 2023

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

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Refacto parameter handling in RAO : parameters are reorganized, optional/ not optional parameters are redefined. This induces profound changes in json serializer/deserializer classes. In addition to these changes, all parameters can now be loaded from a yaml file.

!! DO NOT DELETE BRANCH FOR THE MOMENT TO KEEP CONVERTER !!

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Rao parameters must be refactored according to new organisation

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

@Godelaine Godelaine added PR: waiting-for-review This PR is waiting to be reviewed and removed PR: WIP labels Mar 3, 2023
import com.farao_community.farao.rao_api.parameters.extensions.LoopFlowParametersExtension;
import com.farao_community.farao.rao_api.parameters.extensions.LoopFlowParametersExtension.*;

import java.util.Objects;

/**
* @author Joris Mancini {@literal <joris.mancini at rte-france.com>}
*/
public class LoopFlowParameters {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this class still necessary ? can't we replace its usages with LoopFlowParametersExtension ?

if (Objects.isNull(relativeMarginParameters)) {
throw new FaraoException("No relative margins parameters were defined with objective function " + raoParameters.getObjectiveFunctionParameters().getObjectiveFunctionType());
}
return new MaxMinRelativeMarginParameters(relativeMarginParameters.getPtdfSumLowerBound());
Copy link
Collaborator

Choose a reason for hiding this comment

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

same for this class


/**
* @author Joris Mancini {@literal <joris.mancini at rte-france.com>}
*/
// TODO : classe doublon par rapport à la classe parametre ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree

raoParameters.getPstPenaltyCost(),
raoParameters.getHvdcPenaltyCost(),
raoParameters.getInjectionRaPenaltyCost());
return new RangeActionParameters(raoParameters.getRangeActionsOptimizationParameters().getPstModel(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

same, class is redundant

return new SolverParameters(raoParameters.getSolver(),
raoParameters.getRelativeMipGap(),
raoParameters.getSolverSpecificParameters());
return new SolverParameters(raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolver(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

@pet-mit
Copy link
Collaborator

pet-mit commented Mar 6, 2023

you have to remove sensi fallback mode from SystematicSensitivityInterface & SystematicSensitivityResult.
Also remove ComputationStatus.FALLBACK enum value, and all its usages.

@@ -96,6 +96,10 @@ public LoadFlowAndSensitivityParameters getLoadFlowAndSensitivityParameters() {
return loadFlowAndSensitivityParameters;
}

public boolean hasExtension(RaoParameters raoParameters, Class classType) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need the raoParameters argument, use "this"

@pet-mit pet-mit merged commit a77597b into master Mar 8, 2023
@pet-mit pet-mit deleted the refacto_parameters branch March 8, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: waiting-for-review This PR is waiting to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants