Exemplo n.º 1
0
def test_determine_stubs(feeder_network):
    net = feeder_network
    sec_bus = pp.create_bus(net, vn_kv=20.)
    sec_line = pp.create_line(net, 3, sec_bus, length_km=3, std_type="NA2XS2Y 1x185 RM/25 12/20 kV")
    top.determine_stubs(net)
    assert not np.any(net.bus.on_stub.loc[set(net.bus.index) - {sec_bus}].values)
    assert not np.any(net.line.is_stub.loc[set(net.line.index) - {sec_line}].values)
    assert net.bus.on_stub.at[sec_bus]
    assert net.line.is_stub.at[sec_line]
Exemplo n.º 2
0
def test_determine_stubs_mixed(mixed_network):
    net = mixed_network
    stubs = top.determine_stubs(net, roots=[1, 4, 3])
    assert stubs == {0}
    stubs = top.determine_stubs(net, roots=[4, 3, 1])
    assert stubs == {0}
Exemplo n.º 3
0
def test_determine_stubs_meshed(meshed_network):
    net = meshed_network
    # root == LV side of trafo at ext_grid. Then ext_grid bus itself (0) == stub
    stubs = top.determine_stubs(net, roots=[1])
    assert len(stubs) == 1
    assert stubs.pop() == 0