Skip to content

Error using EHVHV grid with run_timeseries #20

@Svosw

Description

@Svosw

Hi,

Thank you for all the hard work in maintaining this package!

I have stumbled upon an error when trying to use the 1-EHVHV-mixed-all-1-no_sw grid. See the following minimal example to reproduce the error:

import simbench as sb
from pandapower.timeseries.run_time_series import run_timeseries

# The first grid works, the second doesn't
working_grid = "1-EHVHV-mixed-all-0-no_sw"
non_working_grid = "1-EHVHV-mixed-all-1-no_sw"

net_working = sb.get_simbench_net(working_grid)
net_non_working = sb.get_simbench_net(non_working_grid)

profiles_working = sb.get_absolute_values(
    net_working, profiles_instead_of_study_cases=True
)
profiles_non_working = sb.get_absolute_values(
    net_non_working, profiles_instead_of_study_cases=True
)

sb.apply_const_controllers(net_working, profiles_working)
sb.apply_const_controllers(net_non_working, profiles_non_working)

# check that all needed profiles existent
assert not sb.profiles_are_missing(net_working)
assert not sb.profiles_are_missing(net_non_working)

timesteps = range(96)

# This run_timeseries should work
run_timeseries(net_working, timesteps)

# The following run_timeseries results in an error
run_timeseries(net_non_working, timesteps)

Trying to use the run_timeseries function from pandapower with the 1-EHVHV-mixed-all-1-no_sw grid results in the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/timeseries/run_time_series.py", line 346, in run_timeseries
    run_loop(net, ts_variables, **kwargs)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/timeseries/run_time_series.py", line 318, in run_loop
    run_time_step(net, time_step, ts_variables, run_control_fct, output_writer_fct, **kwargs)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/timeseries/run_time_series.py", line 121, in run_time_step
    run_control_fct(net, run_control=False, ctrl_variables=ts_variables, **kwargs)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/control/run_control.py", line 293, in run_control
    control_implementation(net, controller_order, ctrl_variables, max_iter, **kwargs)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/control/run_control.py", line 216, in control_implementation
    ctrl_variables = evaluate_net_fct(net, levelorder, ctrl_variables, **kwargs)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/control/run_control.py", line 180, in _evaluate_net
    run_funct(net, **kwargs)  # run can be runpp, runopf or whatever
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/run.py", line 205, in runpp
    _recycled_powerflow(net, **kwargs)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/powerflow.py", line 121, in _recycled_powerflow
    _build_gen_ppc(net, ppc)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/build_gen.py", line 53, in _build_gen_ppc
    add_element_to_gen(net, ppc, element, f, t)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/build_gen.py", line 82, in add_element_to_gen
    _build_pp_gen(net, ppc, f, t)
  File "[...]/.venv/lib/python3.8/site-packages/pandapower/build_gen.py", line 198, in _build_pp_gen
    gen_buses = bus_lookup[net["gen"]["bus"].values[gen_is]]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 338 but corresponding boolean dimension is 342

The same error also appears with 1-EHVHV-mixed-all-2-no_sw.

Can you have a look at what is going on?

I'm using pandapower 2.7.0 with Simbench 1.3.0.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions