Skip to content

Migration guide v3.0.0

MioRtia edited this page Oct 24, 2019 · 25 revisions

Configuration Changes

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>

Loadflow API change

  • LoadFlowFactory has been removed.
  • Loadflow implementations must inherit from LoadFlowProvider and not LoadFlow anymore and configured to be accessible though java.util.ServiceLoader.
  • LoadFlow is 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 LoadFlowProvider is 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: MyLf

Deprecated getMaximumB() in ShuntCompensator

The 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();

Replace getProperties() in Identifiable by setProperty() and getProperty()

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");

Make CGMES catalogs final

CgmesConformity1Catalog, CgmesConformity1ModifiedCatalog, CgmesConformity1NetworkCatalog, Cim14SmallCasesNetworkCatalog and Cim14SmallCasesCatalog have been made final. From now, creating a new instance of the class is not needed to use one of their network creation method. For example, you have to replace:

Network network = new Cim14SmallCasesCatalog().ieee14();

by:

Network network = Cim14SmallCasesCatalog.ieee14();
Clone this wiki locally