Source code for grid2op.Space.addDetailedTopo

# Copyright (c) 2024, RTE (https://www.rte-france.com)
# See AUTHORS.txt
# This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0.
# If a copy of the Mozilla Public License, version 2.0 was not distributed with this file,
# you can obtain one at http://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0
# This file is part of Grid2Op, Grid2Op a testbed platform to model sequential decision making in power systems.

from grid2op.Space.detailed_topo_description import DetailedTopoDescription


[docs]class AddDetailedTopoIEEE: """This class allows to add some detailed topology for the ieee network (not present in the file most of the time) If you want to use it, you can by doing the following (or something similar) .. code-block:: python import grid2op from grid2op.Space import AddDetailedTopoIEEE from grid2op.Backend import PandaPowerBackend # or any other backend (*eg* lightsim2grid) class PandaPowerBackendWithDetailedTopo(AddDetailedTopoIEEE, PandaPowerBackend): pass env_name = "l2rpn_case14_sandbox" env = grid2op.make(env_name, backend=PandaPowerBackendWithDetailedTopo()) # do wathever you want """ def load_grid(self, path=None, filename=None): super().load_grid(path, filename) self.detailed_topo_desc = DetailedTopoDescription.from_ieee_grid(self)