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 when disconnecting lines with set bus actions #134

Closed
Tezirg opened this issue Jul 20, 2020 · 0 comments · Fixed by #139
Closed

Error when disconnecting lines with set bus actions #134

Tezirg opened this issue Jul 20, 2020 · 0 comments · Fixed by #139
Labels
bug Something isn't working

Comments

@Tezirg
Copy link
Contributor

Tezirg commented Jul 20, 2020

Environment

  • Grid2op version: 1.1.1
  • System: ubuntu20

Bug description

Setting a line extremity bus to -1 will cause IndexError

How to reproduce

Code snippet

import grid2op
import numpy as np
print (grid2op.__version__)
env = grid2op.make("rte_case14_realistic")
action = env.action_space({'set_bus': {'substations_id': [(2, [-1, 0, 0, 0])]}})
print (action)
obs, reward, done, info = env.step(action)

Current output

1.1.1
This action will:
	 - NOT change anything to the injections
	 - NOT perform any redispatching action
	 - NOT force any line status
	 - NOT switch any line status
	 - NOT switch anything in the topology
	 - Set the bus of the following element:
	 - disconnect line (extremity) 2 [on substation 2]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tezirg/Code/Grid2Op.bdonnot/grid2op/Environment/BaseEnv.py", line 906, in step
    self._backend_action += self.env_modification
  File "/home/tezirg/Code/Grid2Op.bdonnot/grid2op/Action/_BackendAction.py", line 293, in __iadd__
    self.current_topo.set_status(self._status_or_before[disco_before_topo],
  File "/home/tezirg/Code/Grid2Op.bdonnot/grid2op/Action/_BackendAction.py", line 108, in set_status
    self.values[id_reco_or] = old_vect[id_reco_or]
IndexError: index 4 is out of bounds for axis 0 with size 1

Expected output

1.1.1
This action will:
	 - NOT change anything to the injections
	 - NOT perform any redispatching action
	 - NOT force any line status
	 - NOT switch any line status
	 - NOT switch anything in the topology
	 - Set the bus of the following element:
	 - disconnect line (extremity) 2 [on substation 2]
Line_ex[2] is disconnected without error.
@Tezirg Tezirg added the bug Something isn't working label Jul 20, 2020
Tezirg referenced this issue in BDonnot/Grid2Op Jul 30, 2020
BDonnot referenced this issue in BDonnot/Grid2Op Jul 31, 2020
BDonnot referenced this issue in BDonnot/Grid2Op Aug 3, 2020
…tebook thus finishing to rationalize rte-france#134
@BDonnot BDonnot linked a pull request Aug 3, 2020 that will close this issue
BDonnot added a commit that referenced this issue May 3, 2021
Adding a few features and fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant