Closed Alwinator closed 2 years ago
I haven't tested it due to lack of time unfortunately. Can you post the individual values?
len(self.grid.ext_grid), len(obs.gen_type), len(self.grid.gen), len(self.grid.ext_grid)
Probably only the parse function needs to be modified slightly.
len(self.grid.ext_grid) = 0 len(obs.gen_type) = 22 len(self.grid.gen) = 22
If you change it to two separate asserts, does it work?
assert len(self.grid.ext_grid) == 1 or self.grid.gen.slack.any() assert len(obs.gen_type) == len(self.grid.gen) + len(self.grid.ext_grid)
Basically the external grid as a reference is missing, but this could just be a generator. If any generator has the attribute "slack" set to True, then the rest of the code should be fine. If ext_grid is referenced later in the code, it should be replaced by a loc to the res_gen.loc[res_gen.slack]. I can do it later this week.
Now the assertion works, but I get a new error:
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 125, in act
self.parse_observation_to_grid(observation)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 75, in parse_observation_to_grid
self.grid.gen.type = obs.gen_type[:-1]
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandas/core/generic.py", line 5303, in __setattr__
self[name] = value
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandas/core/frame.py", line 2938, in __setitem__
self._set_item(key, value)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandas/core/frame.py", line 3000, in _set_item
value = self._sanitize_column(key, value)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandas/core/frame.py", line 3636, in _sanitize_column
value = sanitize_index(value, self.index, copy=False)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 611, in sanitize_index
raise ValueError("Length of values does not match length of index")
ValueError: Length of values does not match length of index
Yes the whole code is written under the assumption that there is an ext_grid available.
self.grid.gen.type = obs.gen_type[:-1]
This should now be
self.grid.gen.type = obs.gen_type
etc. There are some other things to change, but i can modify it tomorrow at the earliest.
There are some other things to change, but i can modify it tomorrow at the earliest.
Thank you! I'll test it tomorrow again!
Can you try with the current commit?
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 169, in act
p_dispatched_current = np.array(self.grid.gen.p_mw.tolist() + self.grid.ext_grid.p_mw.tolist())
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'p_mw'
now?
Unfortunately, yes.
i mean with my latest commit, does it still appear?
Yes
i don't have the new competition setup unfortunately, so i cannot easily try myself. but try again now please.
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
OPF failed
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 150, in act
if line_state["indisponibility"] > 0:
KeyError: 'indisponibility'
OPF failed is not an error, it just means that the OPF cannot solve this problem or some inputs are not parsed correctly.
About the later error, according to the docs of state_of, the key should exist so it seems to be an issue with Grid2Op. https://grid2op.readthedocs.io/en/latest/observation.html#grid2op.Observation.BaseObservation.state_of
Should I send you the check_your_submission.py script? Then you can better check the code.
You can ask in the Grid2Op Discord why indisponibility does not exist and if that is intended, then i can fix it accordingly.
I cannot really do anything about the OPF failed, that's part of the challenge i guess to make it run.
I also reported the issue on the Discord server.
indisponibility
does not exists anymore, the docstring is still present tough.
The correct key to use is cooldown_time
okay, replaced it with cooldown_time
If you export the grid with pp.to_json(...) right before the OPF is called (when it fails), i can take a look tomorrow if there's anything done to easily solve it, but i'm afraid that's all the time i can spend on it.
I mean the exception is gone, but still OPF failed all the time.
If you export the grid with pp.to_json(...) right before the OPF is called (when it fails), i can take a look tomorrow if there's anything done to easily solve it, but i'm afraid that's all the time i can spend on it.
I also get the following messages:
OPF failed
...
Observation: Line 18 out of service!
...
Observation: Line 13 out of service!
...
Observation: Line 14 out of service!
...
Observation: Line 9 out of service!
...
Observation: Line 40 out of service!
...
Observation: Line 41 out of service!
...
Observation: Line 45 out of service!
...
Observation: Line 23 out of service!
...
Observation: Line 27 out of service!
...
Observation: Line 39 out of service!
...
Observation: trafo 1 out of service!
That's likely a cascading failure because the first issue was not handled correctly.
You can try with
import pandapower.toolbox as ppt ppt.opf_task(self.grid)
before the OPF, maybe it can give you some information about what's wrong.
Now I also tried it with PowerModels and it works for approximately 1 minute without OPF failed, but then it caches:
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 202, in act
action_space["redispatch"] = [(idx, p) for idx, p in zip(np.arange(len(self.grid.gen) + 1)[gen_p_redispatched],
IndexError: boolean index did not match indexed array along dimension 0; dimension is 23 but corresponding boolean dimension is 22
okay that should be fixed now
The error above is fixed, but I get get the following new error:
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 175, in act
self.opf_type.lower(), logger=self.logger)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/pp_functions.py", line 55, in run_opf
pp.runpm_ots(grid, pm_nl_solver="ipopt", pm_model="ACPPowerModel") # PowerModels.jl OPF
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandapower/runpm.py", line 320, in runpm_ots
_runpm(net)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandapower/opf/run_powermodels.py", line 38, in _runpm
read_pm_results_to_net(net, ppc, ppci, result_pm)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandapower/converter/powermodels/from_pm.py", line 18, in read_pm_results_to_net
result, multinetwork = pm_results_to_ppc_results(net, ppc, ppci, result_pm)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/pandapower/converter/powermodels/from_pm.py", line 51, in pm_results_to_ppc_results
for i, bus in sol["bus"].items():
KeyError: 'bus'
That's an issue i have no idea about, you can post in the pandapower Github, but will probably not receive a response in the next days, so you would have to debug yourself.
Hello @jhmenke, I am back. The bug in pandapower should now be fixed with the latest commit in the develop branch. Now the PandaPowerOPFAgent need some changes, because pp.runpm_ots function can throw an OPFNotConverged Exception. I tried to improve your code as following:
(pp_functions.py)
try:
pp.runpm_ots(grid, pm_nl_solver="ipopt", pm_model="ACPPowerModel") # PowerModels.jl OPF
grid.line.loc[:, "in_service"] = grid.res_line.loc[:, "in_service"].values.astype(bool)
grid.trafo.loc[:, "in_service"] = grid.res_trafo.loc[:, "in_service"].values.astype(bool)
except OPFNotConverged:
pass
But still, after around 30 minutes I get an exception:
------------------------------------
Detailed error Logs
------------------------------------
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 236, in act
assert not denied, f"{reason} {action}"
AssertionError: Grid2OpException AmbiguousAction InvalidRedispatching "Some redispatching amount are bellow the maximum ramp down" This action will:
- NOT change anything to the injections
- Redispatch gen_41_19 of -10.400001525878906
- Redispatch gen_45_20 of 1.309594750404358
- Redispatch gen_54_26 of 2.7095935344696045
- Redispatch gen_55_29 of 2.7095935344696045
- Redispatch gen_64_35 of -2.79998779296875
- Redispatch gen_68_37 of 6.471207618713379
- force reconnection of 1 powerlines ([34])
- force disconnection of 1 powerlines ([57])
- NOT switch any line status
- NOT switch anything in the topology
- Set the bus of the following element:
- assign bus 1 to line (origin) 34 [on substation 23]
- assign bus 1 to line (extremity) 34 [on substation 25]
------------------------------------
End Detailed error Logs
------------------------------------
Could you please take a look what is wrong.
Thank you in advance!
Can you check what the ramp_down limits are for gen with name gen_41_19? It's probably -10. but somehow PowerModels chose -10.4 despite it being illegal.
edit: If that is the case, you need to np.clip the redispatch vector into the range of the ramp up / down and then assign the residual power to a generator that is not near it's ramp limits. This should happen in https://github.com/jhmenke/grid2op_pp_baseline/blob/2656137da11c4163fa7ef3757aae350d27f8eb65/PandapowerOPFAgent.py#L194 ff but it seems there could be a bug.
Actually, this selects the first ramped down generator, which may not be the best choice always. You can change it so that the generator with the least ramp down is chosen instead:
power_down = np.argmax(p_redispatched[np.where(p_redispatched < 0)])
Thanks, but then I get the following:
ERROR: ingestion program failed with error:
object of type 'numpy.int64' has no len()
------------------------------------
Detailed error Logs
------------------------------------
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 200, in act
p_redispatched[power_down] -= redispatch_sum / len(power_down)
TypeError: object of type 'numpy.int64' has no len()
------------------------------------
End Detailed error Logs
------------------------------------
So you can confirm that is the problem in the first place?
this should work then (if you confirm then i will push a fix)
if redispatch_sum > 0.:
power_up = np.argmin(p_redispatched[np.where(p_redispatched > 0)])
p_redispatched[power_up] -= redispatch_sum
elif redispatch_sum < 0.:
power_down = np.argmax(p_redispatched[np.where(p_redispatched < 0)])
p_redispatched[power_down] -= redispatch_sum
So you can confirm that is the problem in the first place?
Yes, the p_redispatched includes a -10.3999939.
this should work then (if you confirm then i will push a fix)
Thank you, I will try it, but it takes time. Last time it took 50 minutes until the error appeared.
Unfortunately it crashed in the next line:
assert abs(p_redispatched[gen_p_redispatched].sum()) < 1e-14
abs(p_redispatched[gen_p_redispatched].sum()) = -1.3294594621022853
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 204, in act
assert abs(p_redispatched[gen_p_redispatched].sum()) < 1e-14
AssertionError
That's weird since the overall sum should still be the same. It's probably best to debug this right in the code at the point of failure. The sum of p_redispatched[gen_p_redispatched] should be zero for a valid redispatch action.
Ohh sorry I forgot the abs(). The result is +1.3294594621022853, but still there is the AssertionError
Doesn't matter,
if redispatch_sum > 0.: power_up = np.argmin(p_redispatched[np.where(p_redispatched > 0)]) p_redispatched[power_up] -= redispatch_sum elif redispatch_sum < 0.: power_down = np.argmax(p_redispatched[np.where(p_redispatched < 0)]) p_redispatched[power_down] -= redispatch_sum
This should make the sum 0., maybe -= has to be switched to += or something like that.. as i said, you can probably solve it easily in the debugger
Unfortunately I did not find the problem. Could you please fix the problems. If you want I can send you all scripts you need. Thanks you in advance!
Can you export the p_redispatched, redispatch_sum and gen_p_redispatched variables via numpy.save(...) right after line 194 (when the sum is computed)? Then i could take a look.
Thank you!
This is the archive including the three numpy files: github.tar.gz
please see the latest commit
After 50 minutes:
Traceback (most recent call last):
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 306, in <module>
main()
File "/home/alwin/PycharmProjects/l2rpn-challenge/submission/utils/ingestion_program_local//ingestion.py", line 282, in main
agent_seeds=agent_seeds,
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 1076, in run
env_seeds=env_seeds, max_iter=max_iter, agent_seeds=agent_seeds)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 819, in _run_sequential
max_iter=max_iter)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 592, in run_one_episode
pbar=pbar, env_seed=env_seed, max_iter=max_iter, agent_seed=agent_seed)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/grid2op/Runner/Runner.py", line 694, in _run_one_episode
act = agent.act(obs, reward, done)
File "/home/alwin/miniconda3/envs/l2rpn_challenge/lib/python3.7/site-packages/l2rpn_baselines/PandapowerOPFAgent/PandapowerOPFAgent.py", line 238, in act
assert not denied, f"{reason} {action}"
AssertionError: Grid2OpException AmbiguousAction InvalidRedispatching "Some redispatching amount are bellow the maximum ramp down" This action will:
- NOT change anything to the injections
- Redispatch gen_41_19 of -9.769369125366211
- Redispatch gen_45_20 of 1.3999968767166138
- Redispatch gen_54_26 of 2.799999237060547
- Redispatch gen_55_29 of 2.799999237060547
- Redispatch gen_60_32 of -4.30000114440918
- Redispatch gen_64_35 of -2.79998779296875
- Redispatch gen_68_37 of 9.869362831115723
- force reconnection of 2 powerlines ([41 57])
- NOT switch any line status
- NOT switch anything in the topology
- Set the bus of the following element:
- assign bus 1 to line (origin) 41 [on substation 26]
- assign bus 1 to line (extremity) 41 [on substation 28]
- assign bus 1 to line (extremity) 57 [on substation 28]
- assign bus 1 to line (origin) 57 [on substation 31]
Not sure what it could be now, you confirmed that -10 is the allowed ramp down, right?
No, you said it might be -10. ramp_down: array([ -5., -10., 0., 0., -10.], dtype=float32) I am not sure, but for me it looks like it depends on the generator.
Sure, then it's weird that the OPF wants to set -10 when the limit is -5.
It parsed here: https://github.com/jhmenke/grid2op_pp_baseline/blob/2656137da11c4163fa7ef3757aae350d27f8eb65/PandapowerOPFAgent.py#L121
Are you sure that you don't want to try it with the official check_your_submission.py script? You can download it here. No account required.
yes i don't have Julia set up and can unfortunately not spend a large amount of time on debugging - sorry. it should be easily debugged though
Is the PandaPowerOPFAgent compatible with the new l2rpn_neurips_2020_track1 environment?
I created a small submission for testing purposes:
__init__.py
my_baseline.py
Afterwards I run check_submission.py. I got the following error:
Thank you in advance!