-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support of validation level for missing permanent limit #2939
Conversation
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
…wsybl-core into validation-level-patl
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/ValidationUtil.java
Show resolved
Hide resolved
iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ActivePowerLimitsAdderImpl.java
Outdated
Show resolved
Hide resolved
iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractLoadingLimits.java
Outdated
Show resolved
Hide resolved
iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/AbstractTreeDataImporter.java
Outdated
Show resolved
Hide resolved
iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/ImportOptions.java
Outdated
Show resolved
Hide resolved
network.setMinimumAcceptableValidationLevel(ValidationLevel.EQUIPMENT); | ||
network.getLine("NHV1_NHV2_1").getCurrentLimits2().orElseThrow().setPermanentLimit(Double.NaN); | ||
assertTrue(Double.isNaN(network.getLine("NHV1_NHV2_1").getCurrentLimits2().orElseThrow().getPermanentLimit())); | ||
assertEquals(ValidationLevel.STEADY_STATE_HYPOTHESIS, network.getValidationLevel()); // not supported through setters... |
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 think it is important to have this.
This relies on the ValidationUtil.checkIdentifiable(...)
method which should now consider the limits to determine the validation level of a network.
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 pushed modifications to take the limits into account when determining the validation level of the network.
I chose to consider all the OperationalLimitsGroup
s (the selected and the unselected) since it is easier to do: when considering only the selected ones, the validation level should be checked every time the selected operationalLimitsGroup is changed for any limits holder.
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/AbstractTreeDataImporter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Olivier Perrin <olivier.perrin@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.
Mostly okay for me, only small remarks
iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/AbstractTreeDataImporter.java
Show resolved
Hide resolved
iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/ImportOptions.java
Outdated
Show resolved
Hide resolved
iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/NetworkSerDe.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Quality Gate passedIssues Measures |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Feature
What is the current behavior?
If a
LoadingLimit
has temporary limits, the permanent limit is mandatory. This is imposed by the way the limit violations detection works. When importing an IIDM network, if a permanent limit is missing :At this subject, see #2636
With this principle, it is not possible to import a network (especially of an older IIDM version) and prompt a user for the missing permanent limits.
What is the new behavior (if this is a feature change)?
With this PR, it is possible have IIDM networks with missing permanent limits (either created via the API or imported) as long as the validation level is
EQUIPMENT
.When importing an IIDM network, it is possible to override its minimum validation level. To do this, you should use the following import parameter:
iidm.import.minimal-validation-level: EQUIPMENT
.Operational limits are now considered by the validation level mechanism:
When adding operational limits on a network element with a missing permanent limit, or when settting a permanent limit to Double.NaN, the operation will:
EQUIPMENT
;EQUIPMENT
;EQUIPEMENT
, but the minimum validation level is. In this case, the validation level will be lowered toEQUIPMENT
.When only a missing permanent limit prevents a network to be in
STEADY_STATE_HYPOTHESIS
level, using theLoadingLimits.setPermanentLimit(...)
method to define it a value will increase the validation level of the network toSTEADY_STATE_HYPOTHESIS
.Note that all operational limits are taken into account to determine the validation level. It is also the case for the operational limits defined in a non-selected
OperationalLimitsGroup
(the group is not currently used for the corresponding network element).Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
The following utilitary methods:
ValidationUtil.checkLoadingLimits(...)
;ValidationUtil.checkPermanentLimit(...)
;now take two additional parameters:
boolean throwException
: should the method throw an exception when a missing permanent limit is detected?ReportNode reportNode
: the reportNode to use to log potential errors. You can useReportNode.NO_OP
if you are not interested by this log.Other information: