diff --git a/.vscode/cspell.json b/.vscode/cspell.json new file mode 100644 index 0000000..582ec6d --- /dev/null +++ b/.vscode/cspell.json @@ -0,0 +1,94 @@ +{ + // Version of the setting file. Always 0.2 + "version": "0.2", + // language - current active spelling language + "language": "en,fr", + // words - list of words to be always considered correct + "words": [ + "abcn", + "absolufy", + "acsr", + "aldrey", + "asarray", + "astype", + "bline", + "bnline", + "bnpline", + "bysource", + "cohl", + "cosgini", + "cterm", + "curmg", + "cython", + "direc", + "dline", + "dropna", + "dtype", + "elmlodmv", + "elmpvsys", + "furo", + "gpslat", + "gpslon", + "gscale", + "htmlcov", + "ilini", + "imiso", + "inom", + "isort", + "mathjax", + "mathrm", + "mlei", + "nbsphinx", + "ndarray", + "nlnph", + "nneutral", + "noloadloss", + "normhkva", + "nphase", + "nphases", + "nplin", + "opendss", + "pcutr", + "pgini", + "phasor", + "phasors", + "phtech", + "pipx", + "plini", + "pmatrix", + "pmax", + "pyproj", + "pyproject", + "pytest", + "pyupgrade", + "qgini", + "qlini", + "qurs", + "raphson", + "rline", + "rnline", + "rnpline", + "rtol", + "sgini", + "slini", + "strn", + "susceptance", + "transfo", + "uknom", + "uktr", + "ureg", + "utrn", + "xline", + "xlpe", + "xnet", + "xnline", + "xnpline", + "yesqa" + ], + // flagWords - list of words to be always considered incorrect + // This is useful for offensive words and common spelling errors. + // For example "hte" should be "the" + "flagWords": [ + "hte" + ] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..51acae9 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "charliermarsh.ruff", + "esbenp.prettier-vscode", + "ms-python.python", + "ms-python.vscode-pylance", + ], +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4ad513a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,33 @@ +{ + // Jupyter Notebook + "jupyter.notebookFileRoot": "${workspaceFolder}", + "notebook.formatOnSave.enabled": true, + "notebook.codeActionsOnSave": { + "source.organizeImports.ruff": "explicit", + }, + + // Python + "python.analysis.diagnosticSeverityOverrides": { + "reportInvalidStringEscapeSequence": "warning", + "reportImportCycles": "warning", + "reportUnusedImport": "warning", + }, + "python.testing.pytestEnabled": true, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports.ruff": "explicit", + }, + }, + // Prettier + "prettier.printWidth": 120, + "[markdown][yaml][html][css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + }, + // Json + "[json]": { + "editor.indentSize": 2, + }, +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..689358f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,44 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "options": { "cwd": "${workspaceFolder}" }, + "presentation": { + "showReuseMessage": true, + "clear": true, + }, + "tasks": [ + { + "label": "Build docs", + "detail": "Build the docs using Sphinx.", + "type": "shell", + "command": "make -C doc html", + "group": { + "kind": "build", + "isDefault": true, + }, + "problemMatcher": [], + "presentation": { + "reveal": "silent", + "focus": true, + }, + }, + { + "label": "Open docs", + "detail": "Open the docs in the browser.", + "type": "shell", + "command": "open build/html/index.html", + "presentation": { + "reveal": "never", + "close": true, + "focus": false, + "panel": "dedicated", + }, + "group": { + "kind": "build", + "isDefault": true, + }, + "isBackground": true, + }, + ], +} diff --git a/pyproject.toml b/pyproject.toml index 9954446..f000204 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ dependencies = [ "pandas>=1.4.0", "geopandas>=1.0.0", "shapely>=2.0.0", - "regex>=2022.1.18", "pint>=0.21.0", "typing-extensions>=4.6.2", "pyproj>=3.3.0", @@ -57,6 +56,8 @@ dev = [ "pytest-cov>=5.0.0", "pytest-xdist>=3.1.0", "coverage[toml]>=7.0.5", + "networkx>=3.4.2", + "matplotlib>=3.9.2", ] [tool.uv] diff --git a/roseau/load_flow_single/__init__.py b/roseau/load_flow_single/__init__.py index e91ca7b..1465ea3 100644 --- a/roseau/load_flow_single/__init__.py +++ b/roseau/load_flow_single/__init__.py @@ -15,22 +15,24 @@ __status__, __url__, ) -from roseau.load_flow_single.models.branches import AbstractBranch -from roseau.load_flow_single.models.buses import Bus -from roseau.load_flow_single.models.core import Element -from roseau.load_flow_single.models.lines import Line, LineParameters -from roseau.load_flow_single.models.loads import ( +from roseau.load_flow_single.models import ( + AbstractBranch, AbstractLoad, + Bus, Control, CurrentLoad, + Element, FlexibleParameter, ImpedanceLoad, + Line, + LineParameters, PowerLoad, Projection, + Switch, + Transformer, + TransformerParameters, + VoltageSource, ) -from roseau.load_flow_single.models.sources import VoltageSource -from roseau.load_flow_single.models.switches import Switch -from roseau.load_flow_single.models.transformers import Transformer, TransformerParameters from roseau.load_flow_single.network import ElectricalNetwork __version__ = importlib.metadata.version("roseau-load-flow-single") diff --git a/roseau/load_flow_single/models/__init__.py b/roseau/load_flow_single/models/__init__.py index 9e74bca..693665c 100644 --- a/roseau/load_flow_single/models/__init__.py +++ b/roseau/load_flow_single/models/__init__.py @@ -1,19 +1,14 @@ +from roseau.load_flow import Projection, TransformerParameters from roseau.load_flow_single.models.branches import AbstractBranch from roseau.load_flow_single.models.buses import Bus from roseau.load_flow_single.models.core import Element -from roseau.load_flow_single.models.lines import Line, LineParameters -from roseau.load_flow_single.models.loads import ( - AbstractLoad, - Control, - CurrentLoad, - FlexibleParameter, - ImpedanceLoad, - PowerLoad, - Projection, -) +from roseau.load_flow_single.models.flexible_parameters import Control, FlexibleParameter +from roseau.load_flow_single.models.line_parameters import LineParameters +from roseau.load_flow_single.models.lines import Line +from roseau.load_flow_single.models.loads import AbstractLoad, CurrentLoad, ImpedanceLoad, PowerLoad from roseau.load_flow_single.models.sources import VoltageSource from roseau.load_flow_single.models.switches import Switch -from roseau.load_flow_single.models.transformers import Transformer, TransformerParameters +from roseau.load_flow_single.models.transformers import Transformer __all__ = [ "Element", diff --git a/roseau/load_flow_single/models/loads/flexible_parameters.py b/roseau/load_flow_single/models/flexible_parameters.py similarity index 100% rename from roseau/load_flow_single/models/loads/flexible_parameters.py rename to roseau/load_flow_single/models/flexible_parameters.py diff --git a/roseau/load_flow_single/models/lines/parameters.py b/roseau/load_flow_single/models/line_parameters.py similarity index 100% rename from roseau/load_flow_single/models/lines/parameters.py rename to roseau/load_flow_single/models/line_parameters.py diff --git a/roseau/load_flow_single/models/lines/lines.py b/roseau/load_flow_single/models/lines.py similarity index 99% rename from roseau/load_flow_single/models/lines/lines.py rename to roseau/load_flow_single/models/lines.py index 87c0375..8f6d147 100644 --- a/roseau/load_flow_single/models/lines/lines.py +++ b/roseau/load_flow_single/models/lines.py @@ -9,7 +9,7 @@ from roseau.load_flow_engine.cy_engine import CyShuntLine, CySimplifiedLine from roseau.load_flow_single.models.branches import AbstractBranch from roseau.load_flow_single.models.buses import Bus -from roseau.load_flow_single.models.lines.parameters import LineParameters +from roseau.load_flow_single.models.line_parameters import LineParameters logger = logging.getLogger(__name__) diff --git a/roseau/load_flow_single/models/lines/__init__.py b/roseau/load_flow_single/models/lines/__init__.py deleted file mode 100644 index 06fe1f6..0000000 --- a/roseau/load_flow_single/models/lines/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from roseau.load_flow_single.models.lines.lines import Line -from roseau.load_flow_single.models.lines.parameters import LineParameters - -__all__ = ["Line", "LineParameters"] diff --git a/roseau/load_flow_single/models/loads/loads.py b/roseau/load_flow_single/models/loads.py similarity index 100% rename from roseau/load_flow_single/models/loads/loads.py rename to roseau/load_flow_single/models/loads.py diff --git a/roseau/load_flow_single/models/loads/__init__.py b/roseau/load_flow_single/models/loads/__init__.py deleted file mode 100644 index 2509765..0000000 --- a/roseau/load_flow_single/models/loads/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from roseau.load_flow.models.loads.flexible_parameters import Projection -from roseau.load_flow_single.models.loads.flexible_parameters import Control, FlexibleParameter -from roseau.load_flow_single.models.loads.loads import AbstractLoad, CurrentLoad, ImpedanceLoad, PowerLoad - -__all__ = ["PowerLoad", "AbstractLoad", "FlexibleParameter", "Control", "Projection", "CurrentLoad", "ImpedanceLoad"] diff --git a/roseau/load_flow_single/models/tests/test_buses.py b/roseau/load_flow_single/models/tests/test_buses.py index c91fb72..9a27722 100644 --- a/roseau/load_flow_single/models/tests/test_buses.py +++ b/roseau/load_flow_single/models/tests/test_buses.py @@ -104,6 +104,7 @@ def test_voltage_limits(): bus.max_voltage_level = None # Bad values + bus.nominal_voltage = 400 bus.min_voltage_level = 0.95 with pytest.raises(RoseauLoadFlowException) as e: bus.max_voltage_level = 0.92 @@ -185,7 +186,7 @@ def test_propagate_limits(): # noqa: C901 lp_mv = LineParameters(id="lp_mv", z_line=1.0, y_shunt=0.1) lp_lv = LineParameters(id="lp_lv", z_line=1.0) - tp = TransformerParameters.from_catalogue(name="SE_Minera_A0Ak_100kVA", manufacturer="SE") + tp = TransformerParameters.from_catalogue(name="SE Minera A0Ak 100kVA 15/20kV(20) 410V Dyn11") Line(id="l1_mv", bus1=b1_mv, bus2=b2_mv, length=1.5, parameters=lp_mv) Line(id="l2_mv", bus1=b2_mv, bus2=b3_mv, length=2, parameters=lp_mv) @@ -341,7 +342,7 @@ def test_get_connected_buses(): lp_mv = LineParameters(id="lp_mv", z_line=1.0, y_shunt=0.1) lp_lv = LineParameters(id="lp_lv", z_line=1.0) - tp = TransformerParameters.from_catalogue(name="SE_Minera_A0Ak_100kVA", manufacturer="SE") + tp = TransformerParameters.from_catalogue(name="SE Minera A0Ak 100kVA 15/20kV(20) 410V Dyn11") Line(id="l1_mv", bus1=b1_mv, bus2=b2_mv, length=1.5, parameters=lp_mv) Line(id="l2_mv", bus1=b2_mv, bus2=b3_mv, length=2, parameters=lp_mv) diff --git a/roseau/load_flow_single/models/tests/test_flexible_parameters.py b/roseau/load_flow_single/models/tests/test_flexible_parameters.py index 90011b5..9afc899 100644 --- a/roseau/load_flow_single/models/tests/test_flexible_parameters.py +++ b/roseau/load_flow_single/models/tests/test_flexible_parameters.py @@ -1,5 +1,3 @@ -import warnings - import numpy as np import pytest @@ -56,14 +54,14 @@ def test_control(): assert e.value.code == RoseauLoadFlowExceptionCode.BAD_CONTROL_VALUE # Warning if values provided to useless values - with warnings.catch_warnings(record=True) as records: + with pytest.warns( + UserWarning, + match=( + r"Some voltage norm value\(s\) will not be used by the 'p_max_u_production' control. " + r"Nevertheless, values different from 0 were given: 'u_min' \(2.0 V\), 'u_down' \(1.0 V\)" + ), + ): Control(type="p_max_u_production", u_min=2, u_down=1, u_up=240, u_max=250) - assert len(records) == 1 - assert ( - records[0].message.args[0] == "Some voltage norm value(s) will not be used by the 'p_max_u_production' " - "control. Nevertheless, values different from 0 were given: 'u_min' (2.0 V), 'u_down' (1.0 V)" - ) - assert records[0].category is UserWarning # Bad control value for p_max_u_consumption with pytest.raises(RoseauLoadFlowException) as e: @@ -102,15 +100,14 @@ def test_control(): assert e.value.code == RoseauLoadFlowExceptionCode.BAD_CONTROL_VALUE # Warning if values provided to useless values - with warnings.catch_warnings(record=True) as records: + with pytest.warns( + UserWarning, + match=( + r"Some voltage norm value\(s\) will not be used by the 'p_max_u_consumption' control. " + r"Nevertheless, values different from 0 were given: 'u_max' \(-1.0 V\), 'u_up' \(2.3 V\)" + ), + ): Control(type="p_max_u_consumption", u_min=210, u_down=220, u_up=2.3, u_max=-1) - assert len(records) == 1 - assert ( - records[0].message.args[0] == "Some voltage norm value(s) will not be used by the 'p_max_u_consumption' " - "control. Nevertheless, values different from 0 were given: 'u_max' (-1.0 " - "V), 'u_up' (2.3 V)" - ) - assert records[0].category is UserWarning # Bad control value for q_u with pytest.raises(RoseauLoadFlowException) as e: diff --git a/roseau/load_flow_single/models/tests/test_line_parameters.py b/roseau/load_flow_single/models/tests/test_line_parameters.py index 150da3c..74c64de 100644 --- a/roseau/load_flow_single/models/tests/test_line_parameters.py +++ b/roseau/load_flow_single/models/tests/test_line_parameters.py @@ -691,8 +691,8 @@ def test_equality(): other_data = { "id": lp.id + " other", - "z_line": lp.z_line.m + 1, - "y_shunt": lp.y_shunt.m + 1, + "z_line": lp.z_line.m + 1j, + "y_shunt": lp.y_shunt.m + 1j, "ampacity": lp.ampacity.m + 1, "line_type": LineType.OVERHEAD, "material": Material.CU, diff --git a/roseau/load_flow_single/models/tests/test_transformer_parameters.py b/roseau/load_flow_single/models/tests/test_transformer_parameters.py deleted file mode 100644 index 1eeba3c..0000000 --- a/roseau/load_flow_single/models/tests/test_transformer_parameters.py +++ /dev/null @@ -1,741 +0,0 @@ -import numbers - -import numpy as np -import pandas as pd -import pytest -from pint import DimensionalityError - -from roseau.load_flow.exceptions import RoseauLoadFlowException, RoseauLoadFlowExceptionCode -from roseau.load_flow.units import Q_ -from roseau.load_flow_single.models import TransformerParameters - - -def test_transformer_parameters(): - # Example in the "transformers" document of Victor. - # Yzn11 - 50kVA - data = { - "id": "Yzn11 - 50kVA", - "psc": 1350.0, # W - "p0": 145.0, # W - "i0": 1.8 / 100, # % - "us": 400, # V - "up": 20000, # V - "sn": 50 * 1e3, # VA - "vsc": 4 / 100, # % - "type": "yzn11", - } - tp = TransformerParameters.from_dict(data) - - r_iron = 20e3**2 / 145 # Ohm - lm_omega = 20e3**2 / (np.sqrt((1.8 / 100 * 50e3) ** 2 - 145**2)) # H *rad/s - z2_norm = 4 / 100 * 400**2 / 50e3 - r2 = 1350 * 400**2 / 50e3**2 # Ohm - l2_omega = np.sqrt(z2_norm**2 - r2**2) # H*rad/s - - ym_expected = 1 / r_iron + 1 / (1j * lm_omega) - z2_expected = r2 + 1j * l2_omega - k_expected = 400 / (np.sqrt(3.0) * 20e3) - orientation_expected = 1.0 - - assert np.isclose(tp.z2.m, z2_expected) - assert np.isclose(tp.ym.m, ym_expected) - assert np.isclose(tp.k.m, k_expected) - assert np.isclose(tp.orientation, orientation_expected) - - # Dyn11 - 100kVA - data = { - "id": "Dyn11 - 100kVA", - "psc": 2150.0, # W - "p0": 210.0, # W - "i0": 3.5 / 100, # % - "us": 400, # V - "up": 20000, # V - "sn": 100 * 1e3, # VA - "vsc": 4 / 100, # % - "type": "dyn11", - } - tp = TransformerParameters.from_dict(data) - r_iron = 3 * 20e3**2 / 210 # Ohm - lm_omega = 3 * 20e3**2 / (np.sqrt((3.5 / 100 * 100e3) ** 2 - 210**2)) # H*rad/s - z2_norm = 4 / 100 * 400**2 / 100e3 - r2 = 2150 * 400**2 / 100e3**2 # Ohm - l2_omega = np.sqrt(z2_norm**2 - r2**2) # H*rad/s - - ym_expected = 1 / r_iron + 1 / (1j * lm_omega) - z2_expected = r2 + 1j * l2_omega - k_expected = (400 / np.sqrt(3)) / 20e3 - orientation_expected = 1.0 - - assert np.isclose(tp.z2.m, z2_expected) - assert np.isclose(tp.ym.m, ym_expected) - assert np.isclose(tp.k.m, k_expected) - assert np.isclose(tp.orientation, orientation_expected) - - # Dyn5 - 160kVA - data = { - "id": "Dyn5 - 160kVA", - "psc": 2350.0, # W - "p0": 460.0, # W - "i0": 5.6 / 100, # % - "us": 400, # V - "up": 20000, # V - "sn": 160 * 1e3, # VA - "vsc": 4 / 100, # % - "type": "dyn5", - } - tp = TransformerParameters.from_dict(data) - r_iron = 3 * 20e3**2 / 460 # Ohm - lm_omega = 3 * 20e3**2 / (np.sqrt((5.6 / 100 * 160e3) ** 2 - 460**2)) # H*rad/s - z2_norm = 4 / 100 * 400**2 / 160e3 - r2 = 2350 * 400**2 / 160e3**2 # Ohm - l2_omega = np.sqrt(z2_norm**2 - r2**2) # H*rad/s - - ym_expected = 1 / r_iron + 1 / (1j * lm_omega) - z2_expected = r2 + 1j * l2_omega - k_expected = 400 / np.sqrt(3) / 20e3 - orientation_expected = -1.0 - - assert np.isclose(tp.z2.m, z2_expected) - assert np.isclose(tp.ym.m, ym_expected) - assert np.isclose(tp.k.m, k_expected) - assert np.isclose(tp.orientation, orientation_expected) - - # Check that there is an error if the winding is not good - data = { - "id": "test", - "psc": 2350.0, # W - "p0": 460.0, # W - "i0": 5.6 / 100, # % - "us": 400, # V - "up": 20000, # V - "sn": 160 * 1e3, # VA - "vsc": 4 / 100, # % - "type": "dtotoyn11", - } - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_dict(data) - assert "Transformer windings cannot be extracted from the string" in e.value.msg - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_WINDINGS - - # Bad i0 - data = { - "id": "test", - "psc": 2350.0, # W - "p0": 460.0, # W - "i0": 5.6, # % - "us": 400, # V - "up": 20000, # V - "sn": 160 * 1e3, # VA - "vsc": 4 / 100, # % - "type": "dyn11", - } - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_dict(data) - assert "Invalid open-circuit test current i0=" in e.value.msg - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_PARAMETERS - - # Bad vsc - data = { - "id": "test", - "psc": 2350.0, # W - "p0": 460.0, # W - "i0": 5.6 / 100, # % - "us": 400, # V - "up": 20000, # V - "sn": 160 * 1e3, # VA - "vsc": 4, # % - "type": "dyn11", - } - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_dict(data) - assert "Invalid short-circuit test voltage vsc=" in e.value.msg - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_PARAMETERS - - # Bad l2_omega - data = { - "id": "test", - "type": "Dyn11", - "sn": 50000.0, - "up": 20000.0, - "us": 400.0, - "i0": 0.027, - "p0": 210.0, - "psc": 2150.0, - "vsc": 0.04, - } - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_dict(data) - assert "The following inequality must be respected: psc/sn <= vsc" in e.value.msg - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_PARAMETERS - - -def test_transformers_parameters_units(): - # Example in the "transformers" document of Victor. - # Yzn11 - 50kVA. Good units - data = { - "id": "Yzn11 - 50kVA", - "z2": Q_(8.64 + 9.444j, "centiohm"), # Ohm - "ym": Q_(0.3625 - 2.2206j, "uS"), # S - "us": Q_(400, "V"), # V - "up": Q_(20, "kV"), # V - "sn": Q_(50, "kVA"), # VA - "type": "yzn11", - } - tp = TransformerParameters(**data) - assert np.isclose(tp._z2, (0.0864 + 0.0944406692j)) - assert np.isclose(tp._ym, (3.625e-07 - 2.2206e-06j)) - assert np.isclose(tp._us, 400) - assert np.isclose(tp._up, 20000) - assert np.isclose(tp._sn, 50e3) - - # Bad unit for each of them - for param, fake_quantity in ( - ("z2", Q_(1350.0, "A")), - ("ym", Q_(145.0, "A")), - ("us", Q_(400, "A")), - ("up", Q_(20, "A")), - ("sn", Q_(50, "A")), - ): - copy_data = data.copy() - copy_data[param] = fake_quantity - with pytest.raises( - DimensionalityError, match=r"Cannot convert from 'ampere' \(\[current\]\) to '\w+?' \(.+?\)" - ): - TransformerParameters(**copy_data) - - -def test_transformers_parameters_units_from_tests(): - # Example in the "transformers" document of Victor. - # Yzn11 - 50kVA. Good units - data = { - "id": "Yzn11 - 50kVA", - "psc": Q_(1350.0, "W"), # W - "p0": Q_(145.0, "W"), # W - "i0": Q_(1.8, "percent"), # % - "us": Q_(400, "V"), # V - "up": Q_(20, "kV"), # V - "sn": Q_(50, "kVA"), # VA - "vsc": Q_(4, "percent"), # % - "type": "yzn11", - } - tp = TransformerParameters.from_open_and_short_circuit_tests(**data) - assert np.isclose(tp._psc, 1350.0) - assert np.isclose(tp._p0, 145.0) - assert np.isclose(tp._i0, 1.8e-2) - assert np.isclose(tp._us, 400) - assert np.isclose(tp._up, 20000) - assert np.isclose(tp._sn, 50e3) - assert np.isclose(tp._vsc, 4e-2) - - # Bad unit for each of them - for param, fake_quantity in ( - ("psc", Q_(1350.0, "A")), - ("p0", Q_(145.0, "A")), - ("i0", Q_(1.8 / 100, "A")), - ("us", Q_(400, "A")), - ("up", Q_(20, "A")), - ("sn", Q_(50, "A")), - ("vsc", Q_(4 / 100, "A")), - ): - copy_data = data.copy() - copy_data[param] = fake_quantity - with pytest.raises( - DimensionalityError, match=r"Cannot convert from 'ampere' \(\[current\]\) to '\w+?' \(.+?\)" - ): - TransformerParameters.from_open_and_short_circuit_tests(**copy_data) - - -def test_transformer_type(): - valid_windings = ("y", "yn", "z", "zn", "d") - valid_phase_displacements = (0, 5, 6, 11) - valid_types = {"dd", "yy", "yny", "yyn", "ynyn", "dz", "dzn", "dy", "dyn", "yd", "ynd", "yz", "ynz", "yzn", "ynzn"} - valid_full_types = { - "dd0", - "dd6", - "yy0", - "yy6", - "yny0", - "yny6", - "yyn0", - "yyn6", - "ynyn0", - "ynyn6", - "dz0", - "dz6", - "dzn0", - "dzn6", - "dy5", - "dy11", - "dyn5", - "dyn11", - "yd5", - "yd11", - "ynd5", - "ynd11", - "yz5", - "yz11", - "ynz5", - "ynz11", - "yzn5", - "yzn11", - "ynzn5", - "ynzn11", - } - - for winding1 in valid_windings: - for winding2 in valid_windings: - t = f"{winding1}{winding2}" - if t in valid_types: - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.extract_windings(t) - assert "Transformer windings cannot be extracted from the string" in e.value.msg - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_WINDINGS - for phase_displacement in valid_phase_displacements: - t = f"{winding1}{winding2}{phase_displacement}" - if t in valid_full_types: - w1, w2, p = TransformerParameters.extract_windings(t) - assert w1 == winding1.upper() - assert w2 == winding2 - assert p == phase_displacement - else: - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.extract_windings(t) - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_WINDINGS - else: - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.extract_windings(t) - assert "Transformer windings cannot be extracted from the string" in e.value.msg - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_WINDINGS - - -def test_catalogue_data(): - # The catalogue data path exists - catalogue_path = TransformerParameters.catalogue_path() - assert catalogue_path.exists() - - # Read it and copy it - catalogue_data = TransformerParameters.catalogue_data() - - # Iterate over the folder and ensure that the elements are in the catalogue data - error_message = ( - "Something changed in the transformers parameters catalogue. Please regenerate the json files for the " - "transformers catalogue by using the python file `scripts/generate_transformer_parameters_catalogue.py`. " - "Don't forget to delete files that are useless too." - ) - - # Check that the name is unique - assert catalogue_data["name"].is_unique, error_message - - catalogue_data.set_index(keys=["name"], inplace=True) - for idx in catalogue_data.index: - tp = TransformerParameters.from_catalogue(name=idx) - - # The entry of the catalogue has been found - assert tp.id in catalogue_data.index, error_message - - # Check the values are the same - assert tp.type == catalogue_data.at[tp.id, "type"] - assert np.isclose(tp.up.m, catalogue_data.at[tp.id, "up"]) - assert np.isclose(tp.us.m, catalogue_data.at[tp.id, "us"]) - assert np.isclose(tp.sn.m, catalogue_data.at[tp.id, "sn"]) - assert np.isclose(tp.p0.m, catalogue_data.at[tp.id, "p0"]) - assert np.isclose(tp.i0.m, catalogue_data.at[tp.id, "i0"]) - assert np.isclose(tp.psc.m, catalogue_data.at[tp.id, "psc"]) - assert np.isclose(tp.vsc.m, catalogue_data.at[tp.id, "vsc"]) - assert tp.manufacturer == catalogue_data.at[tp.id, "manufacturer"] - assert tp.range == catalogue_data.at[tp.id, "range"] - assert tp.efficiency == catalogue_data.at[tp.id, "efficiency"] - - # Check that the parameters are valid - assert isinstance(tp.z2.m, numbers.Complex) - assert isinstance(tp.ym.m, numbers.Complex) - assert isinstance(tp.k.m, numbers.Real) - assert tp.orientation in (-1.0, 1.0) - - -def test_from_catalogue(): - # Unknown strings - for field_name in ("name", "manufacturer", "range", "efficiency", "type"): - # String - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_catalogue(**{field_name: "unknown"}) - assert e.value.msg.startswith(f"No {field_name} matching 'unknown' has been found. Available ") - assert e.value.code == RoseauLoadFlowExceptionCode.CATALOGUE_NOT_FOUND - - # Regexp - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_catalogue(**{field_name: r"unknown[a-z]+"}) - assert e.value.msg.startswith(f"No {field_name} matching 'unknown[a-z]+' has been found. Available ") - assert e.value.code == RoseauLoadFlowExceptionCode.CATALOGUE_NOT_FOUND - - # Unknown floats - for field_name, display_name, display_unit in ( - ("sn", "nominal power", "kVA"), - ("up", "primary side voltage", "kV"), - ("us", "secondary side voltage", "kV"), - ): - # Without unit - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_catalogue(**{field_name: 3141.5}) - assert e.value.msg.startswith(f"No {display_name} matching 3.1 {display_unit} has been found. Available ") - assert e.value.code == RoseauLoadFlowExceptionCode.CATALOGUE_NOT_FOUND - - # With unit - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_catalogue(**{field_name: Q_(3141.5, display_unit.removeprefix("k"))}) - assert e.value.msg.startswith(f"No {display_name} matching 3.1 {display_unit} has been found. Available ") - assert e.value.code == RoseauLoadFlowExceptionCode.CATALOGUE_NOT_FOUND - - # Several transformers - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_catalogue(type=r"yzn.*", sn=50e3) - assert e.value.msg == ( - "Several transformers matching the query (type='yzn.*', nominal power=50.0 kVA) have been " - "found: 'SE_Minera_A0Ak_50kVA', 'SE_Minera_B0Bk_50kVA', 'SE_Minera_C0Bk_50kVA', " - "'SE_Minera_Standard_50kVA'." - ) - assert e.value.code == RoseauLoadFlowExceptionCode.CATALOGUE_SEVERAL_FOUND - - # Success - tp = TransformerParameters.from_catalogue(name="SE_Minera_AA0Ak_160kVA") - assert tp.id == "SE_Minera_AA0Ak_160kVA" - tp = TransformerParameters.from_catalogue(name="SE_Minera_AA0Ak_160kVA", id="tp-test1") - assert tp.id == "tp-test1" - - -def test_get_catalogue(): - # Get the entire catalogue - catalogue = TransformerParameters.get_catalogue() - assert isinstance(catalogue, pd.DataFrame) - assert catalogue.shape == (162, 7) - - # Filter on a single attribute - for field_name, value, expected_size in ( - ("name", "SE_Minera_A0Ak_50kVA", 1), - ("manufacturer", "SE", 148), - ("range", r"min.*", 67), - ("efficiency", r"c0.*", 29), - ("type", r"dy.*", 158), - ("sn", Q_(160, "kVA"), 12), - ("up", Q_(20, "kV"), 162), - ("us", 400, 162), - ): - filtered_catalogue = TransformerParameters.get_catalogue(**{field_name: value}) - assert filtered_catalogue.shape == (expected_size, 7), f"{field_name}={value!r}" - - # Filter on two attributes - for field_name, value, expected_size in ( - ("name", "SE_Minera_A0Ak_50kVA", 1), - ("range", "minera", 67), - ("efficiency", r"c0.*", 29), - ("type", r"^d.*11$", 144), - ("sn", Q_(160, "kVA"), 11), - ("up", Q_(20, "kV"), 148), - ("us", 400, 148), - ): - filtered_catalogue = TransformerParameters.get_catalogue(**{field_name: value}, manufacturer="se") - assert filtered_catalogue.shape == (expected_size, 7), f"{field_name}={value!r}" - - # Filter on three attributes - for field_name, value, expected_size in ( - ("name", "se_VEGETA_C0BK_3150kva", 1), - ("efficiency", r"c0[abc]k", 15), - ("type", r"dyn\d+", 41), - ("sn", Q_(160, "kVA"), 3), - ("up", Q_(20, "kV"), 41), - ("us", 400, 41), - ): - filtered_catalogue = TransformerParameters.get_catalogue( - **{field_name: value}, manufacturer="se", range=r"^vegeta$" - ) - assert filtered_catalogue.shape == (expected_size, 7), f"{field_name}={value!r}" - - # No results - empty_catalogue = TransformerParameters.get_catalogue(us=250) - assert empty_catalogue.shape == (0, 7) - - -def test_from_open_dss(): - """https://sourceforge.net/p/electricdss/discussion/beginners/thread/742e6c9665/ - - Main input data for transformer: - - - Type: two windings transformer - - Phases numbers: 3 - - Apparent rated power: 1800 kVA - - Frequency = 50 Hz - - Rated line voltage in = 33 kV - - Rated line voltage out = 0.405 kV - - Short circuit voltage: 6% - - Short circuit losses: 0.902% - - No load current: 0.3% - - No load losses: 0.136% - - Connections: DYn - - Group No: 11 - - Neutral: distributed at side out (low voltage level) - - Impedance to earth in = 1 MΩ (insulated) - - Impedance to earth out = 0 Ω - - Impedance to earth common = 5 Ω " - - OpenDss Model:: - - New Transformer.Isacco phases=3 windings=2 XHL=6 - ~ wdg=1 bus=MVbusname kV=33 kVA=1800 conn=delta - ~ Wdg=2 bus=LVBusname.1.2.3.4 kV=0.405 kVA=1800 conn=wye - ~ %Loadloss=0.902 %imag=0.3 %noload=.136 LeadLag=Euro - - // Neutral reactor - New Reactor.5-ohm phases=1 bus=LVBusname.4 R=0 X=5 - """ - sn = Q_(1800, "kVA") - tp_rlf = TransformerParameters.from_open_and_short_circuit_tests( - id="tp-test", - # Electrical parameters - type="Dyn11", - up=Q_(33, "kV"), - us=Q_(0.405, "kV"), - sn=sn, - p0=Q_(0.136, "percent") * sn, - i0=Q_(0.3, "percent"), - psc=Q_(0.902, "percent") * sn, - vsc=Q_(6, "percent"), - # Optional parameters - manufacturer="Roseau", - range="Tech+", - efficiency="Wonderful", - ) - - tp_dss = TransformerParameters.from_open_dss( - id="tp-test", - # Electrical parameters - conns=("delta", "wye"), - kvs=(33, 0.405), - kvas=1800, - leadlag="euro", - xhl=6, - loadloss=0.902, - noloadloss=0.136, - imag=0.3, - # Optional parameters - manufacturer="Roseau", - range="Tech+", - efficiency="Wonderful", - ) - - # Electrical parameters - assert tp_rlf.up == tp_dss.up - assert tp_rlf.us == tp_dss.us - assert tp_rlf.sn == tp_dss.sn - assert tp_rlf.k == tp_dss.k - assert tp_rlf.orientation == tp_dss.orientation - np.testing.assert_allclose(tp_rlf.z2.m, tp_dss.z2.m) - np.testing.assert_allclose(tp_rlf.ym.m, tp_dss.ym.m) - - # Optional parameters - assert tp_rlf.manufacturer == tp_dss.manufacturer - assert tp_rlf.range == tp_dss.range - assert tp_rlf.efficiency == tp_dss.efficiency - - -def test_from_power_factory(): - # Parameters from tests/data/dgs/MV_LV_Transformer.json - tp_pwf = TransformerParameters.from_power_factory( - id="Transformer 100 kVA Dyn11", - # Electrical parameters - tech=3, # Three Phase Transformer - sn=0.1, # MVA - uhv=20, # kV - ulv=0.4, # kV - vg_hv="D", - vg_lv="yn", - phase_shift=11, - uk=4, # Vsc (%) - pc=2.15, # Psc (kW) - curmg=2.5, # i0 (%) - pfe=0.21, # P0 (kW) - # Optional parameters - manufacturer="Roseau", - range="Tech+", - efficiency="Wonderful", - ) - tp_rlf = TransformerParameters.from_open_and_short_circuit_tests( - id="Transformer 100 kVA Dyn11", - # Electrical parameters - type="Dyn11", - up=Q_(20, "kV"), - us=Q_(0.4, "kV"), - sn=Q_(0.1, "MVA"), - p0=Q_(0.21, "kW"), - i0=Q_(2.5, "percent"), - psc=Q_(2.15, "kW"), - vsc=Q_(4, "percent"), - # Optional parameters - manufacturer="Roseau", - range="Tech+", - efficiency="Wonderful", - ) - - # Electrical parameters - assert tp_pwf.up == tp_rlf.up - assert tp_pwf.us == tp_rlf.us - assert tp_pwf.sn == tp_rlf.sn - assert tp_pwf.k == tp_rlf.k - assert tp_pwf.orientation == tp_rlf.orientation - np.testing.assert_allclose(tp_pwf.z2.m, tp_rlf.z2.m) - np.testing.assert_allclose(tp_pwf.ym.m, tp_rlf.ym.m) - - # Optional parameters - assert tp_pwf.manufacturer == tp_rlf.manufacturer - assert tp_pwf.range == tp_rlf.range - assert tp_pwf.efficiency == tp_rlf.efficiency - - # Test single phase (only the technology has been changed) - tp_pwf = TransformerParameters.from_power_factory( - id="Transformer 100 kVA Dyn11", - # Electrical parameters - tech="single-phase", # Single Phase Transformer - sn=0.1, # MVA - uhv=20, # kV - ulv=0.4, # kV - vg_hv="D", - vg_lv="yn", - phase_shift=11, - uk=4, # Vsc (%) - pc=2.15, # Psc (kW) - curmg=2.5, # i0 (%) - pfe=0.21, # P0 (kW) - # Optional parameters - manufacturer="Roseau", - range="Tech+", - efficiency="Wonderful", - ) - assert tp_pwf.type == "single" - - # Bad technology - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters.from_power_factory( - id="Transformer 100 kVA Dyn11", - # Electrical parameters - tech="unknown value", # <-------------Error - sn=0.1, # MVA - uhv=20, # kV - ulv=0.4, # kV - vg_hv="D", - vg_lv="yn", - phase_shift=11, - uk=4, # Vsc (%) - pc=2.15, # Psc (kW) - curmg=2.5, # i0 (%) - pfe=0.21, # P0 (kW) - # Optional parameters - manufacturer="Roseau", - range="Tech+", - efficiency="Wonderful", - ) - assert ( - e.value.msg == "Expected tech='single-phase' or 'three-phase', got 'unknown value' for transformer parameters " - "'Transformer 100 kVA Dyn11'." - ) - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_TYPE - - -def test_to_dict(): - # No results to export - tp = TransformerParameters.from_catalogue(name="SE_Minera_A0Ak_100kVA", manufacturer="SE") - with pytest.raises(RoseauLoadFlowException) as e: - tp.results_to_dict() - assert e.value.msg == "The TransformerParameters has no results to export." - assert e.value.code == RoseauLoadFlowExceptionCode.JSON_NO_RESULTS - - # All the options for to_dict: no short-circuit data but Optional data - tp2 = TransformerParameters( - id=tp.id, - type=tp.type, - up=tp.up, - us=tp.us, - sn=tp.sn, - z2=tp.z2, - ym=tp.ym, - manufacturer=tp.manufacturer, - range=tp.range, - efficiency=tp.efficiency, - ) - d = tp2.to_dict() - assert d.pop("id") == tp2.id - assert d.pop("sn") == tp2.sn.m - assert d.pop("up") == tp2.up.m - assert d.pop("us") == tp2.us.m - assert d.pop("type") == tp2.type - assert d.pop("z2") == [tp2.z2.m.real, tp2.z2.m.imag] - assert d.pop("ym") == [tp2.ym.m.real, tp2.ym.m.imag] - assert d.pop("manufacturer") == tp2.manufacturer - assert d.pop("range") == tp2.range - assert d.pop("efficiency") == tp2.efficiency - assert not d - - # Test the from_dict without "p0", ... (only z2 and ym) - tp3 = TransformerParameters.from_dict(tp2.to_dict()) - assert tp3 == tp2 - - -def test_equality(): - data = { - "id": "Yzn11 - 50kVA", - "z2": Q_(8.64 + 9.444j, "centiohm"), # Ohm - "ym": Q_(0.3625 - 2.2206j, "uS"), # S - "us": Q_(400, "V"), # V - "up": Q_(20, "kV"), # V - "sn": Q_(50, "kVA"), # VA - "type": "yzn11", - "manufacturer": "Roseau", - "range": "Tech+", - "efficiency": "Extraordinary", - } - - tp = TransformerParameters(**data) - tp2 = TransformerParameters(**data) - assert tp2 == tp - - # Fails - other_data = { - "id": "Dyn11 - 49kVA", - "z2": Q_(8.63 + 9.444j, "centiohm"), # Ohm - "ym": Q_(0.48 - 2.2206j, "uS"), # S - "us": Q_(399, "V"), # V - "up": Q_(19, "kV"), # V - "sn": Q_(49, "kVA"), # VA - "type": "dyn11", - "manufacturer": "Roso", - "range": "Tech-", - "efficiency": "Less extraordinary", - } - for k, v in other_data.items(): - other_tp = TransformerParameters(**(data | {k: v})) - assert other_tp != tp, k - - # Test the case which returns NotImplemented in the equality operator - assert tp != object() - - -@pytest.mark.no_patch_engine -def test_compute_open_short_circuit_parameters(): - tp = TransformerParameters.from_catalogue(name="SE_Minera_A0Ak_100kVA", manufacturer="SE") - p0, i0 = tp._compute_open_circuit_parameters() - assert np.isclose(p0.m, tp.p0.m) - assert np.isclose(i0.m, tp.i0.m) - - psc, vsc = tp._compute_short_circuit_parameters() - assert np.isclose(psc.m, tp.psc.m, rtol=0.001) - assert np.isclose(vsc.m, tp.vsc.m) - - -def test_ideal_transformer(): - # Ideal transformer not yet supported - with pytest.raises(RoseauLoadFlowException) as e: - TransformerParameters(id="test", type="Dyn11", sn=50e3, up=20e3, us=400, z2=0.0, ym=0.0) - assert e.value.msg == ( - "Transformer type 'test' has a null series impedance z2. Ideal transformers are not supported." - ) - assert e.value.code == RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_IMPEDANCE - # OK - TransformerParameters(id="test", type="Dyn11", sn=50e3, up=20e3, us=400, z2=0.0000001, ym=0.0) diff --git a/roseau/load_flow_single/models/tests/test_transformers.py b/roseau/load_flow_single/models/tests/test_transformers.py index a61fd91..b0a80ff 100644 --- a/roseau/load_flow_single/models/tests/test_transformers.py +++ b/roseau/load_flow_single/models/tests/test_transformers.py @@ -6,7 +6,7 @@ def test_max_power(): - tp = TransformerParameters.from_catalogue(name="FT_Standard_Standard_100kVA") + tp = TransformerParameters.from_catalogue(name="FT 100kVA 15/20kV(20) 400V Dyn11") assert tp.sn == Q_(100, "kVA") bus1 = Bus(id="bus1") @@ -24,7 +24,7 @@ def test_max_loading(): bus1 = Bus(id="bus1") bus2 = Bus(id="bus2") tp = TransformerParameters.from_open_and_short_circuit_tests( - id="tp", psc=1350.0, p0=145.0, i0=1.8 / 100, us=400, up=20000, sn=50 * 1e3, vsc=4 / 100, type="yzn11" + id="tp", vg="Yzn11", sn=50e3, uhv=20e3, ulv=400, p0=145, i0=0.018, psc=1350, vsc=0.04 ) transformer = Transformer(id="transformer", bus1=bus1, bus2=bus2, parameters=tp) @@ -44,7 +44,7 @@ def test_res_violated(): bus1 = Bus(id="bus1") bus2 = Bus(id="bus2") tp = TransformerParameters.from_open_and_short_circuit_tests( - id="tp", psc=1350.0, p0=145.0, i0=1.8 / 100, us=400, up=20000, sn=50 * 1e3, vsc=4 / 100, type="yzn11" + id="tp", vg="Yzn11", sn=50e3, uhv=20e3, ulv=400, p0=145, i0=0.018, psc=1350, vsc=0.04 ) transformer = Transformer(id="transformer", bus1=bus1, bus2=bus2, parameters=tp) @@ -82,7 +82,7 @@ def test_transformer_results(): bus1 = Bus(id="bus1") bus2 = Bus(id="bus2") tp = TransformerParameters.from_open_and_short_circuit_tests( - id="tp", psc=1350, p0=145, i0=0.018, us=400, up=20e3, sn=50e3, vsc=0.04, type="yzn11" + id="tp", vg="Yzn11", sn=50e3, uhv=20e3, ulv=400, p0=145, i0=0.018, psc=1350, vsc=0.04 ) transformer = Transformer(id="transformer", bus1=bus1, bus2=bus2, parameters=tp) diff --git a/roseau/load_flow_single/models/transformers/transformers.py b/roseau/load_flow_single/models/transformers.py similarity index 98% rename from roseau/load_flow_single/models/transformers/transformers.py rename to roseau/load_flow_single/models/transformers.py index 125d16f..2ed981d 100644 --- a/roseau/load_flow_single/models/transformers/transformers.py +++ b/roseau/load_flow_single/models/transformers.py @@ -63,12 +63,12 @@ def __init__( self._parameters = parameters self.max_loading = max_loading - if parameters.type == "center": + if parameters.type == "center-tapped": msg = "Center-tapped transformers are not allowed." logger.error(msg) raise RoseauLoadFlowException(msg=msg, code=RoseauLoadFlowExceptionCode.BAD_TRANSFORMER_WINDINGS) - elif parameters.type == "single": - z2, ym, k_single = parameters._z2, parameters._ym, parameters._k + elif parameters.type == "single-phase": + z2, ym, k_single = parameters._z2, parameters._ym, parameters._k * parameters._orientation else: z2, ym = parameters._z2, parameters._ym k_complex_factor = { diff --git a/roseau/load_flow_single/models/transformers/__init__.py b/roseau/load_flow_single/models/transformers/__init__.py deleted file mode 100644 index 9b8db51..0000000 --- a/roseau/load_flow_single/models/transformers/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from roseau.load_flow.models.transformers.parameters import TransformerParameters -from roseau.load_flow_single.models.transformers.transformers import Transformer - -__all__ = [ - "Transformer", - "TransformerParameters", -] diff --git a/roseau/load_flow_single/network.py b/roseau/load_flow_single/network.py index 529ddc9..57a46df 100644 --- a/roseau/load_flow_single/network.py +++ b/roseau/load_flow_single/network.py @@ -24,15 +24,14 @@ from roseau.load_flow.utils.types import _DTYPES, LoadTypeDtype from roseau.load_flow_engine.cy_engine import CyElectricalNetwork, CyGround, CyPotentialRef from roseau.load_flow_single.io import network_from_dict, network_to_dict -from roseau.load_flow_single.models import Transformer from roseau.load_flow_single.models.branches import AbstractBranch from roseau.load_flow_single.models.buses import Bus from roseau.load_flow_single.models.core import Element from roseau.load_flow_single.models.lines import Line -from roseau.load_flow_single.models.loads import AbstractLoad, PowerLoad -from roseau.load_flow_single.models.loads.loads import CurrentLoad, ImpedanceLoad +from roseau.load_flow_single.models.loads import AbstractLoad, CurrentLoad, ImpedanceLoad, PowerLoad from roseau.load_flow_single.models.sources import VoltageSource from roseau.load_flow_single.models.switches import Switch +from roseau.load_flow_single.models.transformers import Transformer if TYPE_CHECKING: from networkx import Graph @@ -1044,7 +1043,7 @@ def _propagate_potentials(self) -> None: for e in element._connected_elements: if e not in visited: if isinstance(element, Transformer): - k = element.parameters._us / element.parameters._up + k = element.parameters._ulv / element.parameters._uhv elements.append((e, potential * k, element)) # TODO dephasage visited.add(e) else: diff --git a/roseau/load_flow_single/tests/data/networks/all_element_network.json b/roseau/load_flow_single/tests/data/networks/all_element_network.json index c1f2828..632cccf 100644 --- a/roseau/load_flow_single/tests/data/networks/all_element_network.json +++ b/roseau/load_flow_single/tests/data/networks/all_element_network.json @@ -333,9 +333,9 @@ { "id": "630kVA", "sn": 630000.0, - "up": 20000.0, - "us": 400, - "type": "single", + "uhv": 20000.0, + "ulv": 400, + "vg": "Ii0", "z2": [0.02, 0.0], "ym": [1e-7, 0.0] } diff --git a/roseau/load_flow_single/tests/test_electrical_network.py b/roseau/load_flow_single/tests/test_electrical_network.py index e5e903d..c8c51b7 100644 --- a/roseau/load_flow_single/tests/test_electrical_network.py +++ b/roseau/load_flow_single/tests/test_electrical_network.py @@ -77,7 +77,7 @@ def test_connect_and_disconnect(): # Connection of a new connected component load_bus2 = Bus(id="load_bus2") - tp = TransformerParameters(id="630kVA", type="single", sn=630e3, up=20e3, us=400, z2=0.02, ym=1e-7) + tp = TransformerParameters(id="630kVA", vg="Ii0", sn=630e3, uhv=20e3, ulv=400, z2=0.02, ym=1e-7) Transformer(id="transfo", bus1=load_bus, bus2=load_bus2, parameters=tp) # Disconnection of a load @@ -244,7 +244,7 @@ def test_bad_networks(): # No potential reference bus3 = Bus(id="bus3") tp = TransformerParameters.from_open_and_short_circuit_tests( - id="t", type="single", up=20000, us=400, sn=160 * 1e3, p0=460, i0=2.3 / 100, psc=2350, vsc=4 / 100 + id="t", vg="Ii0", uhv=20000, ulv=400, sn=160 * 1e3, p0=460, i0=2.3 / 100, psc=2350, vsc=4 / 100 ) t = Transformer(id="transfo", bus1=bus2, bus2=bus3, parameters=tp) diff --git a/scripts/generate_test_networks.py b/scripts/generate_test_networks.py index 27c70fe..ec950d5 100644 --- a/scripts/generate_test_networks.py +++ b/scripts/generate_test_networks.py @@ -83,7 +83,7 @@ def generate_all_element_network(apl=None) -> None: line0 = rlfs.Line(id="line0", bus1=bus0, bus2=bus1, parameters=lp0, length=rlf.Q_(1.5, "km")) # Transformer between bus1 and bus2 - tp0 = rlfs.TransformerParameters(id="630kVA", type="single", sn=630e3, up=20e3, us=400, z2=0.02, ym=1e-7) + tp0 = rlfs.TransformerParameters(id="630kVA", vg="Ii0", sn=630e3, uhv=20e3, ulv=400, z2=0.02, ym=1e-7) transformer0 = rlfs.Transformer(id="transformer0", bus1=bus1, bus2=bus2, parameters=tp0, tap=1.0) # Switch between the bus2 and the bus3 diff --git a/uv.lock b/uv.lock index e0ee0ea..1e93a44 100644 --- a/uv.lock +++ b/uv.lock @@ -769,79 +769,10 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/11/c3/005fcca25ce078d2cc29fd559379817424e94885510568bc1bc53d7d5846/pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725", size = 508002 }, ] -[[package]] -name = "regex" -version = "2024.11.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8e/5f/bd69653fbfb76cf8604468d3b4ec4c403197144c7bfe0e6a5fc9e02a07cb/regex-2024.11.6.tar.gz", hash = "sha256:7ab159b063c52a0333c884e4679f8d7a85112ee3078fe3d9004b2dd875585519", size = 399494 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/95/3c/4651f6b130c6842a8f3df82461a8950f923925db8b6961063e82744bddcc/regex-2024.11.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ff590880083d60acc0433f9c3f713c51f7ac6ebb9adf889c79a261ecf541aa91", size = 482674 }, - { url = "https://files.pythonhosted.org/packages/15/51/9f35d12da8434b489c7b7bffc205c474a0a9432a889457026e9bc06a297a/regex-2024.11.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:658f90550f38270639e83ce492f27d2c8d2cd63805c65a13a14d36ca126753f0", size = 287684 }, - { url = "https://files.pythonhosted.org/packages/bd/18/b731f5510d1b8fb63c6b6d3484bfa9a59b84cc578ac8b5172970e05ae07c/regex-2024.11.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:164d8b7b3b4bcb2068b97428060b2a53be050085ef94eca7f240e7947f1b080e", size = 284589 }, - { url = "https://files.pythonhosted.org/packages/78/a2/6dd36e16341ab95e4c6073426561b9bfdeb1a9c9b63ab1b579c2e96cb105/regex-2024.11.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3660c82f209655a06b587d55e723f0b813d3a7db2e32e5e7dc64ac2a9e86fde", size = 782511 }, - { url = "https://files.pythonhosted.org/packages/1b/2b/323e72d5d2fd8de0d9baa443e1ed70363ed7e7b2fb526f5950c5cb99c364/regex-2024.11.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d22326fcdef5e08c154280b71163ced384b428343ae16a5ab2b3354aed12436e", size = 821149 }, - { url = "https://files.pythonhosted.org/packages/90/30/63373b9ea468fbef8a907fd273e5c329b8c9535fee36fc8dba5fecac475d/regex-2024.11.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac758ef6aebfc8943560194e9fd0fa18bcb34d89fd8bd2af18183afd8da3a2", size = 809707 }, - { url = "https://files.pythonhosted.org/packages/f2/98/26d3830875b53071f1f0ae6d547f1d98e964dd29ad35cbf94439120bb67a/regex-2024.11.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:997d6a487ff00807ba810e0f8332c18b4eb8d29463cfb7c820dc4b6e7562d0cf", size = 781702 }, - { url = "https://files.pythonhosted.org/packages/87/55/eb2a068334274db86208ab9d5599ffa63631b9f0f67ed70ea7c82a69bbc8/regex-2024.11.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:02a02d2bb04fec86ad61f3ea7f49c015a0681bf76abb9857f945d26159d2968c", size = 771976 }, - { url = "https://files.pythonhosted.org/packages/74/c0/be707bcfe98254d8f9d2cff55d216e946f4ea48ad2fd8cf1428f8c5332ba/regex-2024.11.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f02f93b92358ee3f78660e43b4b0091229260c5d5c408d17d60bf26b6c900e86", size = 697397 }, - { url = "https://files.pythonhosted.org/packages/49/dc/bb45572ceb49e0f6509f7596e4ba7031f6819ecb26bc7610979af5a77f45/regex-2024.11.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06eb1be98df10e81ebaded73fcd51989dcf534e3c753466e4b60c4697a003b67", size = 768726 }, - { url = "https://files.pythonhosted.org/packages/5a/db/f43fd75dc4c0c2d96d0881967897926942e935d700863666f3c844a72ce6/regex-2024.11.6-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:040df6fe1a5504eb0f04f048e6d09cd7c7110fef851d7c567a6b6e09942feb7d", size = 775098 }, - { url = "https://files.pythonhosted.org/packages/99/d7/f94154db29ab5a89d69ff893159b19ada89e76b915c1293e98603d39838c/regex-2024.11.6-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabbfc59f2c6edba2a6622c647b716e34e8e3867e0ab975412c5c2f79b82da2", size = 839325 }, - { url = "https://files.pythonhosted.org/packages/f7/17/3cbfab1f23356fbbf07708220ab438a7efa1e0f34195bf857433f79f1788/regex-2024.11.6-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8447d2d39b5abe381419319f942de20b7ecd60ce86f16a23b0698f22e1b70008", size = 843277 }, - { url = "https://files.pythonhosted.org/packages/7e/f2/48b393b51900456155de3ad001900f94298965e1cad1c772b87f9cfea011/regex-2024.11.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:da8f5fc57d1933de22a9e23eec290a0d8a5927a5370d24bda9a6abe50683fe62", size = 773197 }, - { url = "https://files.pythonhosted.org/packages/45/3f/ef9589aba93e084cd3f8471fded352826dcae8489b650d0b9b27bc5bba8a/regex-2024.11.6-cp310-cp310-win32.whl", hash = "sha256:b489578720afb782f6ccf2840920f3a32e31ba28a4b162e13900c3e6bd3f930e", size = 261714 }, - { url = "https://files.pythonhosted.org/packages/42/7e/5f1b92c8468290c465fd50c5318da64319133231415a8aa6ea5ab995a815/regex-2024.11.6-cp310-cp310-win_amd64.whl", hash = "sha256:5071b2093e793357c9d8b2929dfc13ac5f0a6c650559503bb81189d0a3814519", size = 274042 }, - { url = "https://files.pythonhosted.org/packages/58/58/7e4d9493a66c88a7da6d205768119f51af0f684fe7be7bac8328e217a52c/regex-2024.11.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5478c6962ad548b54a591778e93cd7c456a7a29f8eca9c49e4f9a806dcc5d638", size = 482669 }, - { url = "https://files.pythonhosted.org/packages/34/4c/8f8e631fcdc2ff978609eaeef1d6994bf2f028b59d9ac67640ed051f1218/regex-2024.11.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c89a8cc122b25ce6945f0423dc1352cb9593c68abd19223eebbd4e56612c5b7", size = 287684 }, - { url = "https://files.pythonhosted.org/packages/c5/1b/f0e4d13e6adf866ce9b069e191f303a30ab1277e037037a365c3aad5cc9c/regex-2024.11.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94d87b689cdd831934fa3ce16cc15cd65748e6d689f5d2b8f4f4df2065c9fa20", size = 284589 }, - { url = "https://files.pythonhosted.org/packages/25/4d/ab21047f446693887f25510887e6820b93f791992994f6498b0318904d4a/regex-2024.11.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1062b39a0a2b75a9c694f7a08e7183a80c63c0d62b301418ffd9c35f55aaa114", size = 792121 }, - { url = "https://files.pythonhosted.org/packages/45/ee/c867e15cd894985cb32b731d89576c41a4642a57850c162490ea34b78c3b/regex-2024.11.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:167ed4852351d8a750da48712c3930b031f6efdaa0f22fa1933716bfcd6bf4a3", size = 831275 }, - { url = "https://files.pythonhosted.org/packages/b3/12/b0f480726cf1c60f6536fa5e1c95275a77624f3ac8fdccf79e6727499e28/regex-2024.11.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d548dafee61f06ebdb584080621f3e0c23fff312f0de1afc776e2a2ba99a74f", size = 818257 }, - { url = "https://files.pythonhosted.org/packages/bf/ce/0d0e61429f603bac433910d99ef1a02ce45a8967ffbe3cbee48599e62d88/regex-2024.11.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2a19f302cd1ce5dd01a9099aaa19cae6173306d1302a43b627f62e21cf18ac0", size = 792727 }, - { url = "https://files.pythonhosted.org/packages/e4/c1/243c83c53d4a419c1556f43777ccb552bccdf79d08fda3980e4e77dd9137/regex-2024.11.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bec9931dfb61ddd8ef2ebc05646293812cb6b16b60cf7c9511a832b6f1854b55", size = 780667 }, - { url = "https://files.pythonhosted.org/packages/c5/f4/75eb0dd4ce4b37f04928987f1d22547ddaf6c4bae697623c1b05da67a8aa/regex-2024.11.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9714398225f299aa85267fd222f7142fcb5c769e73d7733344efc46f2ef5cf89", size = 776963 }, - { url = "https://files.pythonhosted.org/packages/16/5d/95c568574e630e141a69ff8a254c2f188b4398e813c40d49228c9bbd9875/regex-2024.11.6-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:202eb32e89f60fc147a41e55cb086db2a3f8cb82f9a9a88440dcfc5d37faae8d", size = 784700 }, - { url = "https://files.pythonhosted.org/packages/8e/b5/f8495c7917f15cc6fee1e7f395e324ec3e00ab3c665a7dc9d27562fd5290/regex-2024.11.6-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:4181b814e56078e9b00427ca358ec44333765f5ca1b45597ec7446d3a1ef6e34", size = 848592 }, - { url = "https://files.pythonhosted.org/packages/1c/80/6dd7118e8cb212c3c60b191b932dc57db93fb2e36fb9e0e92f72a5909af9/regex-2024.11.6-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:068376da5a7e4da51968ce4c122a7cd31afaaec4fccc7856c92f63876e57b51d", size = 852929 }, - { url = "https://files.pythonhosted.org/packages/11/9b/5a05d2040297d2d254baf95eeeb6df83554e5e1df03bc1a6687fc4ba1f66/regex-2024.11.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f2c4184420d881a3475fb2c6f4d95d53a8d50209a2500723d831036f7c45", size = 781213 }, - { url = "https://files.pythonhosted.org/packages/26/b7/b14e2440156ab39e0177506c08c18accaf2b8932e39fb092074de733d868/regex-2024.11.6-cp311-cp311-win32.whl", hash = "sha256:c36f9b6f5f8649bb251a5f3f66564438977b7ef8386a52460ae77e6070d309d9", size = 261734 }, - { url = "https://files.pythonhosted.org/packages/80/32/763a6cc01d21fb3819227a1cc3f60fd251c13c37c27a73b8ff4315433a8e/regex-2024.11.6-cp311-cp311-win_amd64.whl", hash = "sha256:02e28184be537f0e75c1f9b2f8847dc51e08e6e171c6bde130b2687e0c33cf60", size = 274052 }, - { url = "https://files.pythonhosted.org/packages/ba/30/9a87ce8336b172cc232a0db89a3af97929d06c11ceaa19d97d84fa90a8f8/regex-2024.11.6-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:52fb28f528778f184f870b7cf8f225f5eef0a8f6e3778529bdd40c7b3920796a", size = 483781 }, - { url = "https://files.pythonhosted.org/packages/01/e8/00008ad4ff4be8b1844786ba6636035f7ef926db5686e4c0f98093612add/regex-2024.11.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fdd6028445d2460f33136c55eeb1f601ab06d74cb3347132e1c24250187500d9", size = 288455 }, - { url = "https://files.pythonhosted.org/packages/60/85/cebcc0aff603ea0a201667b203f13ba75d9fc8668fab917ac5b2de3967bc/regex-2024.11.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:805e6b60c54bf766b251e94526ebad60b7de0c70f70a4e6210ee2891acb70bf2", size = 284759 }, - { url = "https://files.pythonhosted.org/packages/94/2b/701a4b0585cb05472a4da28ee28fdfe155f3638f5e1ec92306d924e5faf0/regex-2024.11.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b85c2530be953a890eaffde05485238f07029600e8f098cdf1848d414a8b45e4", size = 794976 }, - { url = "https://files.pythonhosted.org/packages/4b/bf/fa87e563bf5fee75db8915f7352e1887b1249126a1be4813837f5dbec965/regex-2024.11.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb26437975da7dc36b7efad18aa9dd4ea569d2357ae6b783bf1118dabd9ea577", size = 833077 }, - { url = "https://files.pythonhosted.org/packages/a1/56/7295e6bad94b047f4d0834e4779491b81216583c00c288252ef625c01d23/regex-2024.11.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abfa5080c374a76a251ba60683242bc17eeb2c9818d0d30117b4486be10c59d3", size = 823160 }, - { url = "https://files.pythonhosted.org/packages/fb/13/e3b075031a738c9598c51cfbc4c7879e26729c53aa9cca59211c44235314/regex-2024.11.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b7fa6606c2881c1db9479b0eaa11ed5dfa11c8d60a474ff0e095099f39d98e", size = 796896 }, - { url = "https://files.pythonhosted.org/packages/24/56/0b3f1b66d592be6efec23a795b37732682520b47c53da5a32c33ed7d84e3/regex-2024.11.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0c32f75920cf99fe6b6c539c399a4a128452eaf1af27f39bce8909c9a3fd8cbe", size = 783997 }, - { url = "https://files.pythonhosted.org/packages/f9/a1/eb378dada8b91c0e4c5f08ffb56f25fcae47bf52ad18f9b2f33b83e6d498/regex-2024.11.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:982e6d21414e78e1f51cf595d7f321dcd14de1f2881c5dc6a6e23bbbbd68435e", size = 781725 }, - { url = "https://files.pythonhosted.org/packages/83/f2/033e7dec0cfd6dda93390089864732a3409246ffe8b042e9554afa9bff4e/regex-2024.11.6-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a7c2155f790e2fb448faed6dd241386719802296ec588a8b9051c1f5c481bc29", size = 789481 }, - { url = "https://files.pythonhosted.org/packages/83/23/15d4552ea28990a74e7696780c438aadd73a20318c47e527b47a4a5a596d/regex-2024.11.6-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:149f5008d286636e48cd0b1dd65018548944e495b0265b45e1bffecce1ef7f39", size = 852896 }, - { url = "https://files.pythonhosted.org/packages/e3/39/ed4416bc90deedbfdada2568b2cb0bc1fdb98efe11f5378d9892b2a88f8f/regex-2024.11.6-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e5364a4502efca094731680e80009632ad6624084aff9a23ce8c8c6820de3e51", size = 860138 }, - { url = "https://files.pythonhosted.org/packages/93/2d/dd56bb76bd8e95bbce684326302f287455b56242a4f9c61f1bc76e28360e/regex-2024.11.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0a86e7eeca091c09e021db8eb72d54751e527fa47b8d5787caf96d9831bd02ad", size = 787692 }, - { url = "https://files.pythonhosted.org/packages/0b/55/31877a249ab7a5156758246b9c59539abbeba22461b7d8adc9e8475ff73e/regex-2024.11.6-cp312-cp312-win32.whl", hash = "sha256:32f9a4c643baad4efa81d549c2aadefaeba12249b2adc5af541759237eee1c54", size = 262135 }, - { url = "https://files.pythonhosted.org/packages/38/ec/ad2d7de49a600cdb8dd78434a1aeffe28b9d6fc42eb36afab4a27ad23384/regex-2024.11.6-cp312-cp312-win_amd64.whl", hash = "sha256:a93c194e2df18f7d264092dc8539b8ffb86b45b899ab976aa15d48214138e81b", size = 273567 }, - { url = "https://files.pythonhosted.org/packages/90/73/bcb0e36614601016552fa9344544a3a2ae1809dc1401b100eab02e772e1f/regex-2024.11.6-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a6ba92c0bcdf96cbf43a12c717eae4bc98325ca3730f6b130ffa2e3c3c723d84", size = 483525 }, - { url = "https://files.pythonhosted.org/packages/0f/3f/f1a082a46b31e25291d830b369b6b0c5576a6f7fb89d3053a354c24b8a83/regex-2024.11.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:525eab0b789891ac3be914d36893bdf972d483fe66551f79d3e27146191a37d4", size = 288324 }, - { url = "https://files.pythonhosted.org/packages/09/c9/4e68181a4a652fb3ef5099e077faf4fd2a694ea6e0f806a7737aff9e758a/regex-2024.11.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:086a27a0b4ca227941700e0b31425e7a28ef1ae8e5e05a33826e17e47fbfdba0", size = 284617 }, - { url = "https://files.pythonhosted.org/packages/fc/fd/37868b75eaf63843165f1d2122ca6cb94bfc0271e4428cf58c0616786dce/regex-2024.11.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bde01f35767c4a7899b7eb6e823b125a64de314a8ee9791367c9a34d56af18d0", size = 795023 }, - { url = "https://files.pythonhosted.org/packages/c4/7c/d4cd9c528502a3dedb5c13c146e7a7a539a3853dc20209c8e75d9ba9d1b2/regex-2024.11.6-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b583904576650166b3d920d2bcce13971f6f9e9a396c673187f49811b2769dc7", size = 833072 }, - { url = "https://files.pythonhosted.org/packages/4f/db/46f563a08f969159c5a0f0e722260568425363bea43bb7ae370becb66a67/regex-2024.11.6-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c4de13f06a0d54fa0d5ab1b7138bfa0d883220965a29616e3ea61b35d5f5fc7", size = 823130 }, - { url = "https://files.pythonhosted.org/packages/db/60/1eeca2074f5b87df394fccaa432ae3fc06c9c9bfa97c5051aed70e6e00c2/regex-2024.11.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cde6e9f2580eb1665965ce9bf17ff4952f34f5b126beb509fee8f4e994f143c", size = 796857 }, - { url = "https://files.pythonhosted.org/packages/10/db/ac718a08fcee981554d2f7bb8402f1faa7e868c1345c16ab1ebec54b0d7b/regex-2024.11.6-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d7f453dca13f40a02b79636a339c5b62b670141e63efd511d3f8f73fba162b3", size = 784006 }, - { url = "https://files.pythonhosted.org/packages/c2/41/7da3fe70216cea93144bf12da2b87367590bcf07db97604edeea55dac9ad/regex-2024.11.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:59dfe1ed21aea057a65c6b586afd2a945de04fc7db3de0a6e3ed5397ad491b07", size = 781650 }, - { url = "https://files.pythonhosted.org/packages/a7/d5/880921ee4eec393a4752e6ab9f0fe28009435417c3102fc413f3fe81c4e5/regex-2024.11.6-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b97c1e0bd37c5cd7902e65f410779d39eeda155800b65fc4d04cc432efa9bc6e", size = 789545 }, - { url = "https://files.pythonhosted.org/packages/dc/96/53770115e507081122beca8899ab7f5ae28ae790bfcc82b5e38976df6a77/regex-2024.11.6-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f9d1e379028e0fc2ae3654bac3cbbef81bf3fd571272a42d56c24007979bafb6", size = 853045 }, - { url = "https://files.pythonhosted.org/packages/31/d3/1372add5251cc2d44b451bd94f43b2ec78e15a6e82bff6a290ef9fd8f00a/regex-2024.11.6-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:13291b39131e2d002a7940fb176e120bec5145f3aeb7621be6534e46251912c4", size = 860182 }, - { url = "https://files.pythonhosted.org/packages/ed/e3/c446a64984ea9f69982ba1a69d4658d5014bc7a0ea468a07e1a1265db6e2/regex-2024.11.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f51f88c126370dcec4908576c5a627220da6c09d0bff31cfa89f2523843316d", size = 787733 }, - { url = "https://files.pythonhosted.org/packages/2b/f1/e40c8373e3480e4f29f2692bd21b3e05f296d3afebc7e5dcf21b9756ca1c/regex-2024.11.6-cp313-cp313-win32.whl", hash = "sha256:63b13cfd72e9601125027202cad74995ab26921d8cd935c25f09c630436348ff", size = 262122 }, - { url = "https://files.pythonhosted.org/packages/45/94/bc295babb3062a731f52621cdc992d123111282e291abaf23faa413443ea/regex-2024.11.6-cp313-cp313-win_amd64.whl", hash = "sha256:2b3361af3198667e99927da8b84c1b010752fa4b1115ee30beaa332cabc3ef1a", size = 273545 }, -] - [[package]] name = "roseau-load-flow" version = "0.10.0" -source = { git = "https://github.com/RoseauTechnologies/Roseau_Load_Flow.git?branch=develop#2c1c2f67ece66c40713ae0fe5c9b5689cc524900" } +source = { git = "https://github.com/RoseauTechnologies/Roseau_Load_Flow.git?branch=develop#b2be2b8066d50ef3df7f8ad9f7525cf318b909cf" } dependencies = [ { name = "certifi" }, { name = "geopandas" }, @@ -850,7 +781,6 @@ dependencies = [ { name = "pint" }, { name = "platformdirs" }, { name = "pyproj" }, - { name = "regex" }, { name = "roseau-load-flow-engine" }, { name = "shapely" }, { name = "typing-extensions" }, @@ -890,7 +820,6 @@ dependencies = [ { name = "pint" }, { name = "platformdirs" }, { name = "pyproj" }, - { name = "regex" }, { name = "roseau-load-flow" }, { name = "roseau-load-flow-engine" }, { name = "shapely" }, @@ -908,6 +837,8 @@ plot = [ [package.dev-dependencies] dev = [ { name = "coverage", extra = ["toml"] }, + { name = "matplotlib" }, + { name = "networkx" }, { name = "pytest" }, { name = "pytest-cov" }, { name = "pytest-xdist" }, @@ -924,7 +855,6 @@ requires-dist = [ { name = "pint", specifier = ">=0.21.0" }, { name = "platformdirs", specifier = ">=4.0.0" }, { name = "pyproj", specifier = ">=3.3.0" }, - { name = "regex", specifier = ">=2022.1.18" }, { name = "roseau-load-flow", git = "https://github.com/RoseauTechnologies/Roseau_Load_Flow.git?branch=develop" }, { name = "roseau-load-flow-engine", specifier = ">=0.16.0a0" }, { name = "shapely", specifier = ">=2.0.0" }, @@ -934,6 +864,8 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ { name = "coverage", extras = ["toml"], specifier = ">=7.0.5" }, + { name = "matplotlib", specifier = ">=3.9.2" }, + { name = "networkx", specifier = ">=3.4.2" }, { name = "pytest", specifier = ">=8.0.0" }, { name = "pytest-cov", specifier = ">=5.0.0" }, { name = "pytest-xdist", specifier = ">=3.1.0" },