Skip to content

Migration guide v4.0.0

MioRtia edited this page Jan 11, 2021 · 7 revisions

Contingency API has changed

Contingency.setId method has been removed

Contingency.checkValidity usage has been replaced by ContingencyList.getValidContingencies. This method is deprecated and will be removed in a future release.

Sensitivity Analysis API has changed

ContingenciesProvider usage has been replaced by List<Contingency> in the PR #1553.

Several methods of the SensitivityAnalysis class have changed. You must change your code to use the new API, and avoid compilation issues. Respectively use:

CompletableFuture<SensitivityAnalysisResult> run(Network network,
                                                 String workingStateId,
                                                 SensitivityFactorsProvider factorsProvider,
                                                 List<Contingency> contingencies,
                                                 SensitivityAnalysisParameters parameters,
                                                 ComputationManager computationManager);

instead of

CompletableFuture<SensitivityAnalysisResult> run(Network network,
                                                 String workingStateId,
                                                 SensitivityFactorsProvider factorsProvider,
                                                 ContingenciesProvider contingenciesProvider,
                                                 SensitivityAnalysisParameters parameters,
                                                 ComputationManager computationManager);

If you were using EmptyContingenciesProvider, you can use Collections.emptyList() instead

Migrate to IIDM/XIIDM 1.5

At this release, IIDM has been changed to version 1.5. For more information about the new features, please read the documentation page about IIDM/IIDM-XML 1.5 evolutions.

API

If you are using a custom implementation of IIDM API (different from the one available in powsybl-iidm-impl), please be sure to update your implementation in order not to throw UnsupportedOperationException when a new method is used.

Serialization

If you are using a XIIDM converter from powsybl-core v3.7.0 and above to write IIDM network files in version 1.5, you should use a XIIDM converter from powsybl-core v3.9.0 to read them as well without issues.

Please note that it is possible to read and write XIIDM files in previous IIDM-XML versions.

In order to write XIIDM files in previous versions (e.g. the version 1.0), you need to use the following configuration property:

import-export-parameters-default-value:
  iidm.export.xml.version: "1.0"

or use the Java object ExportOptions in your parameters with a suitable set version:

... // do something
ExportOptions options = new ExportOptions().setVersion("1.0");
NetworkXml.write(network, options, path);
... // do something

⚠️ Writing XIIDM files in previous versions will only be possible if the network you want to serialize has no new features or has only new features that can be interpreted in the previous versions.

Reading XIIDM files in previous versions does not require any particular configuration.

powsybl-iidm-util artifact has been removed (to avoid split package)

All powsybl-iidm-util classes have been moved to powsybl-iidm-api with in same package. As powsybl-iidm-util depends on powsybl-iidm-api, the only thing to do for migration is to replace powsybl-iidm-util dependency by powsybl-iidm-api if it's not already present in your pom.xml.

Extensions refactoring (to avoid split package)

  • All powsybl-iidm-api extensions have been moved to powsybl-iidm-extensions in the same package (SlackTerminal and LoadDetail)
  • Extensions implementations of powsybl-iidm-extensions have been moved to powsybl-iidm-impl
  • Extensions XML serializers of powsybl-iidm-extensions have been moved to powsybl-iidm-xml-converter

Extensions writer

The XmlWriterContext::getExtensionsWriter() has been deprecated and will be removed in a next release. Please replace the usage of this method:

XmlUtil.writeFloat("rdp", xnode.getRdp(), context.getExtensionsWriter());

by

XmlUtil.writeFloat("rdp", xnode.getRdp(), context.getWriter());

com.powsybl.commons.io.MathUtil has been removed

Clone this wiki locally