Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using EHVHV grid with run_timeseries #20

Open
Svosw opened this issue Dec 7, 2021 · 2 comments
Open

Error using EHVHV grid with run_timeseries #20

Svosw opened this issue Dec 7, 2021 · 2 comments

Comments

@Svosw
Copy link

Svosw commented Dec 7, 2021

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!

@SteffenMeinecke
Copy link
Member

@Svosw, thank you for the easy-to-reproduce issue!
This error was new to me. It is an pandapower issue. So I opened e2nIEE/pandapower#1430. As a quick solution, as long as the bug has been solved, you can use pandapower v2.5.0 if you do not rely on the newer pandapower functions.

@Svosw
Copy link
Author

Svosw commented Dec 15, 2021

Perfect, thank you! Using v2.5.0 resolves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants