Skip to content

Commit 9009189

Browse files
committed
Remove spurious private method and fix a comment
1 parent 00c49be commit 9009189

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

doc/usage/Plotting.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,18 @@ To visualize the voltage profile of a network, use one of the `plot_<backend>` m
5050
... ).plot_plotly().show()
5151
```
5252

53-
<!-- en = rlf.ElectricalNetwork.from_catalogue("LVFeeder36360", "Winter")
53+
<!-- # To generate the following iframe, run:
54+
import roseau.load_flow as rlf
55+
en = rlf.ElectricalNetwork.from_catalogue("LVFeeder36360", "Winter")
5456
en.solve_load_flow()
5557
(
5658
rlf.plotting.voltage_profile(en, mode="min", traverse_transformers=True, distance_unit="m")
5759
.plot_plotly()
5860
.write_html(
59-
"doc/_static/Plotting/Voltage_Profile_LVFeeder36360_Plotly2.html", include_plotlyjs="cdn"
61+
"doc/_static/Plotting/Voltage_Profile_LVFeeder36360_Plotly.html", include_plotlyjs="cdn"
6062
)
61-
) -->
63+
)
64+
-->
6265

6366
<iframe src="../_static/Plotting/Voltage_Profile_LVFeeder36360_Plotly.html" height="500px" width="100%" frameborder="0"></iframe>
6467

roseau/load_flow/plotting.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ def _from_network(
10071007
raise ValueError(f"Bus {starting_bus_id!r} not found in the network.")
10081008

10091009
try:
1010-
distance_factor = cls._get_distance_factor(distance_unit)
1010+
distance_factor = Q_(1.0, units="km").m_as(distance_unit)
10111011
except PintError as e:
10121012
raise ValueError(f"Invalid distance unit: {distance_unit}") from e
10131013

@@ -1149,10 +1149,6 @@ def _ylabel(self) -> str:
11491149
label = f"{self.mode.capitalize()} {label}"
11501150
return label
11511151

1152-
@staticmethod
1153-
def _get_distance_factor(distance_unit: str) -> float:
1154-
return Q_(1.0, units="km").m_as(distance_unit)
1155-
11561152
def _edge_segs(self, edge: "VoltageProfileEdge") -> tuple[tuple[float, float], tuple[float, float]]:
11571153
"""Get the segments for an edge in the form ((x1, y1), (x2, y2))."""
11581154
return (

0 commit comments

Comments
 (0)