-
Notifications
You must be signed in to change notification settings - Fork 8
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
Refactor network loader #367
Conversation
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
# Conflicts: # src/main/java/com/powsybl/openloadflow/sa/AcSecurityAnalysis.java # src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java # src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
# Conflicts: # src/main/java/com/powsybl/openloadflow/equations/EquationUtil.java # src/main/java/com/powsybl/openloadflow/sa/AcSecurityAnalysis.java # src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java # src/test/java/com/powsybl/openloadflow/ac/GeneratorTargetVoltageInconsistencyTest.java # src/test/java/com/powsybl/openloadflow/network/LfNetworkTest.java # src/test/java/com/powsybl/openloadflow/sa/LfContingencyTest.java
src/main/java/com/powsybl/openloadflow/network/impl/LfNetworkLoaderPostProcessor.java
Outdated
Show resolved
Hide resolved
@@ -431,37 +431,33 @@ private static void validate(LfNetwork network, boolean minImpedance) { | |||
} | |||
} | |||
|
|||
public static List<LfNetwork> load(Object network, SlackBusSelector slackBusSelector) { | |||
return load(network, new LfNetworkParameters(slackBusSelector), Reporter.NO_OP); | |||
public static <T> List<LfNetwork> load(T network, LfNetworkLoader<T> networkLoader, SlackBusSelector slackBusSelector) { |
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.
In fact I'm wondering if we shouldn't keep a default network loader. maybe by still using a service loader, as in most cases we're using the LfNetworkLoaderImpl. That would hide the load complexity to people who don't need to customize it.
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.
Keeping a service loader just for that would be a little bit too complex for just package dependency decoupling. This is not the goal of service loaders but more external configuration.
I found another simpler solution: to add Networks.load() methods that simplify the code when we want to load from an IIDM network (Networks is a utility class from com.powsybl.openloadlow.network.iidm package)
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
Also I rethink about |
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restWhat kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
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 or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)