Skip to content

Commit

Permalink
fix a bug introduced by refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Mar 15, 2024
1 parent ffcb564 commit 9bb7f7c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lightsim2grid/lightSimBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ def __init__(self,
self._loader_method = loader_method

self._loader_kwargs = loader_kwargs

#: .. versionadded:: 0.8.0
#: Which type of grid format can be read by your backend.
#: It is "json" if loaded from pandapower or
#: "xiidm" if loaded from pypowsybl.
self.supported_grid_format = None
if loader_method == "pandapower":
self.supported_grid_format = ("json", ) # new in 0.8.0
elif loader_method == "pypowsybl":
self.supported_grid_format = ("xiidm", ) # new in 0.8.0
else:
raise BackendError(f"Uknown loader_metho : '{loader_method}'")

#: .. versionadded:: 0.8.0
#: if set to `True` (default) then the backend will raise a
Expand All @@ -107,6 +95,18 @@ def __init__(self,
stop_if_load_disco,
stop_if_gen_disco)

#: .. versionadded:: 0.8.0
#: Which type of grid format can be read by your backend.
#: It is "json" if loaded from pandapower or
#: "xiidm" if loaded from pypowsybl.
self.supported_grid_format = None
if loader_method == "pandapower":
self.supported_grid_format = ("json", ) # new in 0.8.0
elif loader_method == "pypowsybl":
self.supported_grid_format = ("xiidm", ) # new in 0.8.0
else:
raise BackendError(f"Uknown loader_metho : '{loader_method}'")

# lazy loading because it crashes...
from lightsim2grid._utils import _DoNotUseAnywherePandaPowerBackend
from grid2op.Space import GridObjects # lazy import
Expand Down

0 comments on commit 9bb7f7c

Please sign in to comment.