powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
124 stars 40 forks source link

IIDM Validation Util rework #3021

Closed annetill closed 4 months ago

annetill commented 4 months ago

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?

Quality / Feature

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?

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 ValidationUtil utility class was reworked to ensure that the validation is well performed using a validation level. The impacts are the following:

Except the validate(…) method, all the methods having boolean throwException as a parameter are no more accessible. Instead, you should use the method taking the parameters ValidationLevel validation, ReportNode reportNode. The validation level (which generally corresponds to the network's minimal validation level) will determine if, in case of error, it should be reported in reportNode or if an exception should be thrown. Furthermore, methods having only the ValidationLevel validationLevel parameter now take ReportNode reportNode as an additional parameter.

For instance, you could not use the following methods anymore:

Instead, you should use:


In addition, the following methods were removed or are no more accessible:

Other information:

flo-dup commented 4 months ago

Failed conditions 3.5% Duplication on New Code (required ≤ 3%)

To avoid the duplication we could easily introduce an AbstractTapChangerAdderImpl class.

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
91.7% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud