-
Notifications
You must be signed in to change notification settings - Fork 3
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
Voltage limit override new version #27
Conversation
Signed-off-by: parvy <pierre.arvy@artelys.com>
… voltage level has defined low/high voltage limits (taking into account voltage limit overrides) Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: parvy <pierre.arvy@artelys.com>
@@ -165,7 +165,9 @@ public OpenReacParameters createOpenReacParameters(CommandLine line, | |||
String voltageId = node.get("id").asText(); | |||
double lowerPercent = node.get("lower").asDouble(); | |||
double upperPercent = node.get("upper").asDouble(); | |||
openReacParameters.addSpecificVoltageLimits(Map.of(voltageId, new VoltageLimitOverride(lowerPercent, upperPercent))); |
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.
@geofjamg can we delete the tool now? If yes, I will dot that in a other PR.
Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: parvy <pierre.arvy@artelys.com>
...src/main/java/com/powsybl/openreac/parameters/input/json/VoltageLimitOverrideSerializer.java
Outdated
Show resolved
Hide resolved
String voltageLevelId = null; | ||
VoltageLimitOverride.VoltageLimitType type = null; | ||
boolean isRelative = true; | ||
double overrideValue = 0; |
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.
You might want to initialize to Double.NaN and then the check that the value is in the file will be done when calling the constructor.
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.
Yes, but @p-arvy value must be defined ad so checked at construction.
break; | ||
case "isRelative": | ||
parser.nextToken(); | ||
isRelative = parser.readValueAs(boolean.class); |
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.
Use Boolean.class
.
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.
ok
double deltaHighVoltageLimit = 0; | ||
String voltageLevelId = null; | ||
VoltageLimitOverride.VoltageLimitType type = null; | ||
boolean isRelative = true; |
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.
You might also want to initialize this boolean to null, for that you can use Boolean instead. Or do you want isRelative to have a default value to true if the field is not in the file?
Then you can add a check that isRelative is well defined and if not throw an exception because it's undefined.
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.
ok great, you are right.
Signed-off-by: parvy <pierre.arvy@artelys.com>
…ater than high limit. Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: parvy <pierre.arvy@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?
Other information: