diff --git a/pypowsybl/network/impl/nad_parameters.py b/pypowsybl/network/impl/nad_parameters.py index e1c197fb53..033be64c47 100644 --- a/pypowsybl/network/impl/nad_parameters.py +++ b/pypowsybl/network/impl/nad_parameters.py @@ -21,4 +21,4 @@ def edge_name_displayed(self) -> bool: def _to_c_parameters(self) -> _pp.NadParameters: c_parameters = _pp.NadParameters() c_parameters.edge_name_displayed = self._edge_name_displayed - return c_parameters \ No newline at end of file + return c_parameters diff --git a/pypowsybl/network/impl/network.py b/pypowsybl/network/impl/network.py index aabd729a57..09c0a5a379 100644 --- a/pypowsybl/network/impl/network.py +++ b/pypowsybl/network/impl/network.py @@ -249,6 +249,27 @@ def get_single_line_diagram(self, container_id: str, parameters: SldParameters = return Svg(svg_and_metadata[0], svg_and_metadata[1]) def write_network_area_diagram_svg(self, svg_file: PathOrStr, voltage_level_ids: Union[str, List[str]] = None, + depth: int = 0, high_nominal_voltage_bound: float = -1, + low_nominal_voltage_bound: float = -1, + edge_name_displayed: bool = False) -> None: + """ + .. deprecated:: 1.1.0 + Use :class:`write_network_area_diagram_svg` with `NadParameters` instead. + + Create a network area diagram in SVG format and write it to a file. + Args: + svg_file: a svg file path + voltage_level_id: the voltage level ID, center of the diagram (None for the full diagram) + depth: the diagram depth around the voltage level + high_nominal_voltage_bound: high bound to filter voltage level according to nominal voltage + low_nominal_voltage_bound: low bound to filter voltage level according to nominal voltage + edge_name_displayed: if true displays the edge's names + """ + nad_p = NadParameters(edge_name_displayed=edge_name_displayed) + self.write_network_area_diagram(svg_file, voltage_level_ids, depth, high_nominal_voltage_bound, + low_nominal_voltage_bound, nad_p) + + def write_network_area_diagram(self, svg_file: PathOrStr, voltage_level_ids: Union[str, List[str]] = None, depth: int = 0, high_nominal_voltage_bound: float = -1, low_nominal_voltage_bound: float = -1, nad_parameters: NadParameters = None) -> None: diff --git a/tests/test_network.py b/tests/test_network.py index 26db69dcec..3ad8be9c5c 100644 --- a/tests/test_network.py +++ b/tests/test_network.py @@ -850,7 +850,8 @@ def test_sld_nad(): assert re.search('.*