-
Notifications
You must be signed in to change notification settings - Fork 13
Migration guide v2.7.0
In this release, powsybl-core version has been updated from version 4.5.1 to 4.6.0. From this release, the base-voltages.yml
default file is in powsybl-commons artifact from powsybl-core, instead of in each repository using this configuration class. This allows a unique configuration file across the full powsybl ecosystem. Aside this, no other migration issue should affect you on powsybl-line-diagram. Nonetheless, if you are also using powsybl-core directly, please refer to powsybl-core migration guide to fix any issue due to that migration.
In this release, the "Diagram" API has been simplified: classes VoltageLevelDiagram
and SubstationDiagram
have been removed and replaced by a SingleLineDiagram
classes containing only static methods to draw the diagram. For instance, the following example taken from README.md:
ComponentLibrary componentLibrary = new ConvergenceComponentLibrary();
LayoutParameters layoutParameters = new LayoutParameters()
.setAdaptCellHeightToContent(true)
.setCssLocation(LayoutParameters.CssLocation.INSERTED_IN_SVG);
VoltageLevelDiagram
.build(new NetworkGraphBuilder(network), "N", new SmartVoltageLevelLayoutFactory(network), false)
.writeSvg("",
new DefaultSVGWriter(componentLibrary, layoutParameters),
new DefaultDiagramLabelProvider(network, componentLibrary, layoutParameters),
new TopologicalStyleProvider(network),
Paths.get("/tmp/n.svg"));
can be replaced by following single line:
SingleLineDiagram.draw(network, "N", "/tmp/n.svg");
This simpler API introduced following changes or new behaviours:
- The parameter
useName
of diagrams API is now withinLayoutParameter
. UseLayoutParameter::setUseName
to change its value. -
SmartVoltageLevelLayoutFactory
is used by default inSingleLineDiagram
class. -
TopologicalStyleProvider
is used by default inSingleLineDiagram
class, hence the classDefaultDiagramStyleProvider
has been renamed toBasicStyleProvider
. - The CSS is embedded by default:
LayoutParameters::getCssLocation
isCssLocation.INSERTED_IN_SVG
by default. - The cell height is adapted to content by default:
LayoutParameters::isAdaptCellHeightToContent
istrue
by default.
In this release, the SVGWriter interface has been simplified. All methods have been replaced by a single one:
GraphMetadata write(String prefixId, Graph graph, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider, Writer writer);
If you were using the methods with a Writer
this change should be transparent.
If you were using the methods with a Path
, either use the new SingleLineDiagram
API, or create a Writer
from your Path
.
Starting from this release, the SubstationLayout
, VoltageLevelLayout
and ZoneLayoutlayout
interfaces have been merged into a single Layout
interface.
Starting from this release, node keyword is used only for Node class, and not anymore for nodes (meaning vertices) of ZoneGraph
and SubstationGraph
. Hence the methods SubstationGraph::getNodes
and ZoneGraph::getNodes
are renamed to Graph::getVoltageLevels
and ZoneGraph::getSubstations
respectively. A new method has been introduced to access all the nodes corresponding to a graph: Graph::getAllNodesStream
.
Starting from this release, graph keyword is used only for Graph
class, and not anymore for VoltageLevelGraph
class (unless when obvious). This way:
- method
Node::getGraph
has been renamed toNode::getVoltageLevelGraph
- method
LBSCluster::getGraph
has been renamed toLBSCluster::getVoltageLevelGraph
- method
Block::getGraph
has been renamed toBlock::getVoltageLevelGraph
- method
Cell::getGraph
has been renamed toCell::getVoltageLevelGraph
Nonetheless, RawGraphBuilder.VoltageLevelBuilder::getGraph
has been kept and RawGraphBuilder.SubstationBuilder::getSsGraph
has been replaced by RawGraphBuilder.SubstationBuilder::getGraph
, as the substation keyword is already held by the builder class.