From 66ebdc4835d250d8014788dacdf595b5be933ef3 Mon Sep 17 00:00:00 2001 From: Quinn McCarthy Date: Sat, 22 Aug 2026 21:29:36 -0700 Subject: [PATCH] Fix ssc bus not updated by create_continuous_bus_index #3078 --- CHANGELOG.rst | 1 + pandapower/test/toolbox/test_data_modification.py | 5 ++++- pandapower/toolbox/element_selection.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8fc5b9387b..2d53d8d98b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,7 @@ Change Log [upcoming release] - 2026-..-.. ------------------------------- +- [FIXED] ``create_continuous_bus_index`` (and other toolbox functions relying on ``element_bus_tuples``) now also update the ``bus`` column of the ``ssc`` element table; it was previously missing from the list of bus-referencing elements - [FIXED] restored ``OpenDSSDirect.py`` to the ``all``/``dev`` extras so the OpenDSS converter is exercised (and its coverage reported) in CI again; it was dropped in #3062 because installing it alongside ``pytest~=9.1`` crashed the pytest process on Windows. Root cause (see `dss-extensions/OpenDSSDirect.py#148 `_): pytest enables Python's ``faulthandler`` by default, which intercepts a first-chance Windows structured exception that OpenDSSDirect.py's native backend raises -- and normally handles itself -- during import, and misreports it as fatal. Bracketing the import with ``faulthandler.disable()``/``.enable()`` avoids the false crash while leaving ``faulthandler`` protecting the rest of the test run; the converter now runs on Windows instead of merely skipping there. - [ADDED] OpenDSS converter: series (bus-to-bus) ``Reactor`` elements are now imported as a fixed-impedance ``line``, the pattern some feeder libraries (e.g. EPRI's Ckt5/Ckt7) use to model the substation's Thevenin-equivalent source impedance instead of a ``Transformer``. - [FIXED] impedance element docs: the ``z_tf`` equation used ``rft_pu`` instead of ``rtf_pu``, and the ``gt_pu``/``bt_pu``/``gt0_pu``/``bt0_pu`` shunt parameters were described as being at the ``from_bus`` instead of the ``to_bus``. diff --git a/pandapower/test/toolbox/test_data_modification.py b/pandapower/test/toolbox/test_data_modification.py index 942d23a802..a5c4aa3b44 100644 --- a/pandapower/test/toolbox/test_data_modification.py +++ b/pandapower/test/toolbox/test_data_modification.py @@ -10,7 +10,7 @@ import pytest from pandapower.create import create_measurement, create_empty_network, create_bus, create_load, create_sgen, \ - create_shunt, create_ward + create_shunt, create_ward, create_ssc from pandapower.networks.cigre_networks import create_cigre_network_mv from pandapower.networks.create_examples import example_simple, example_multivoltage from pandapower.run import runpp @@ -138,6 +138,9 @@ def test_continuos_bus_numbering(): create_ward(net, bus0, 2, 1, 1, 2) create_ward(net, bus0, 2, 1, 1, 2) + bus0 = create_bus(net, 0.4, index=9821) + create_ssc(net, bus0, r_ohm=1., x_ohm=1.) + create_continuous_bus_index(net) buses = net.bus.index diff --git a/pandapower/toolbox/element_selection.py b/pandapower/toolbox/element_selection.py index 1f0c7de6ed..f9e1824ac1 100644 --- a/pandapower/toolbox/element_selection.py +++ b/pandapower/toolbox/element_selection.py @@ -665,7 +665,7 @@ def element_bus_tuples(bus_elements=True, branch_elements=True, res_elements=Fal ebts += [("sgen", "bus"), ("load", "bus"), ("ext_grid", "bus"), ("gen", "bus"), ("ward", "bus"), ("xward", "bus"), ("shunt", "bus"), ("storage", "bus"), ("asymmetric_load", "bus"), ("asymmetric_sgen", "bus"), - ("motor", "bus")] + ("motor", "bus"), ("ssc", "bus")] if branch_elements: ebts += [("line", "from_bus"), ("line", "to_bus"), ("impedance", "from_bus"), ("impedance", "to_bus"), ("switch", "bus"), ("trafo", "hv_bus"),