-
Notifications
You must be signed in to change notification settings - Fork 49
Migration guide v3.0.0
The PlatformConfig.defaultConfig() method now requires the user to choose an implementation of the new PlatformConfigProvider interface. To fix the exception, you must add one of the following dependency to your pom.xml:
For all usages but tests:
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-config-classic</artifactId>
<version>3.0.0</version>
</dependency>For tests:
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-config-test</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>-
LoadFlowFactoryhas been removed. - Loadflow implementations must inherit from
LoadFlowProviderand notLoadFlowanymore and configured to be accessible thoughjava.util.ServiceLoader. -
LoadFlowis now a utility class which the the unique entry point for running a loaflow.
To run a loadflow using default implementation:
LoadFlowResult result = LoadFlow.run(network);To run a loaflow using a specific implementation:
LoadFlowResult result = LoadFlow.find("MyLf").run(network);Default implementation is chosen using the following rules:
- if no implementation is found an exception is raised.
- if only one implementation of
LoadFlowProvideris found in the classpath, it is the default implementation - if more than one implementation is found in the classpath, additional configuration is needed in the platform config to select to default implementation by its name:
load-flow:
default: MyLfThe method getMaximumB() in ShuntCompensator interface has been deprecated. From now, replace your code as below:
double maxB = shuntCompensator.getMaximumB();should become:
double maxB = shuntCompensator.getbPerSection() * shuntCompensator.getMaximumSectionCount();The recently added (in powsybl 2.5.0) ValidationWriterFactory::create method which takes a TableFormatterConfig argument has been removed. The deprecated overload of ValidationWriterFactory::create which does not take a TableFormatterConfig argument has been undeprecated and should be reused instead.
The method getProperties() in Identifiable, used to get and update properties of an Identifiable object, has been deprecated. From now, replace your code as below:
generator.getProperties().put("name", "value");should become:
generator.setProperty("name", "value");and
String value = generator.getProperties().getProperty("name");should become:
String value = generator.getProperty("name");