From 9d242617d4d0019c3a44f98d993f6dc3ca05efaa Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Thu, 20 Nov 2025 09:59:23 +0100 Subject: [PATCH 01/16] start dev 1.12.3 branch Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 4 ++++ docs/conf.py | 2 +- grid2op/__init__.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 37ccb6cf..ee9accdf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -100,6 +100,10 @@ Native multi agents support: - add detachment - add change_bus / set_bus +[1.12.3] +----------------------- + + [1.12.2] - 2025-11-18 ---------------------- - [FIXED] an issue preventing to change the way diff --git a/docs/conf.py b/docs/conf.py index 2527c594..d9ef0c2f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = 'Benjamin Donnot' # The full version, including alpha/beta/rc tags -release = '1.12.2' +release = '1.12.3.dev0' version = '1.12' diff --git a/grid2op/__init__.py b/grid2op/__init__.py index c84a9b06..c13c4c5d 100644 --- a/grid2op/__init__.py +++ b/grid2op/__init__.py @@ -11,7 +11,7 @@ Grid2Op a testbed platform to model sequential decision making in power systems. """ -__version__ = '1.12.2' +__version__ = '1.12.3.dev0' __all__ = [ "Action", From e87926a088c5066b8a926a1c8ad4059c53e8da4c Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Thu, 20 Nov 2025 10:36:40 +0100 Subject: [PATCH 02/16] fix some issues in the documentation Signed-off-by: DONNOT Benjamin --- docs/developer.rst | 8 ----- docs/grid2op_dev.rst | 1 - docs/grid2op_extend.rst | 9 ++++++ .../create_an_environment.rst | 0 .../createbackend.rst | 8 ++--- .../env_content.rst | 0 docs/{developer => grid2op_extend}/final.rst | 0 .../observation.rst | 0 docs/index.rst | 2 +- docs/special.rst | 3 +- docs/user/opponent.rst | 31 ++++++++++--------- docs/user/special.rst | 1 + grid2op/Action/baseAction.py | 27 ++++++++++------ grid2op/Backend/educPandaPowerBackend.py | 2 +- grid2op/Backend/pandaPowerBackend.py | 2 +- grid2op/Environment/baseEnv.py | 8 ++--- grid2op/Observation/baseObservation.py | 28 ++++++++--------- 17 files changed, 68 insertions(+), 62 deletions(-) delete mode 100644 docs/developer.rst create mode 100644 docs/grid2op_extend.rst rename docs/{developer => grid2op_extend}/create_an_environment.rst (100%) rename docs/{developer => grid2op_extend}/createbackend.rst (99%) rename docs/{developer => grid2op_extend}/env_content.rst (100%) rename docs/{developer => grid2op_extend}/final.rst (100%) rename docs/{developer => grid2op_extend}/observation.rst (100%) diff --git a/docs/developer.rst b/docs/developer.rst deleted file mode 100644 index f32eb13d..00000000 --- a/docs/developer.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. toctree:: - :maxdepth: 1 - - developer/env_content - developer/create_an_environment - developer/createbackend - -.. include:: final.rst diff --git a/docs/grid2op_dev.rst b/docs/grid2op_dev.rst index 6beedb0d..3d44046d 100644 --- a/docs/grid2op_dev.rst +++ b/docs/grid2op_dev.rst @@ -2,6 +2,5 @@ :maxdepth: 1 grid2op_dev/action - grid2op_dev/observation .. include:: final.rst diff --git a/docs/grid2op_extend.rst b/docs/grid2op_extend.rst new file mode 100644 index 00000000..1bce8296 --- /dev/null +++ b/docs/grid2op_extend.rst @@ -0,0 +1,9 @@ +.. toctree:: + :maxdepth: 1 + + grid2op_extend/env_content + grid2op_extend/create_an_environment + grid2op_extend/createbackend + grid2op_extend/observation + +.. include:: final.rst diff --git a/docs/developer/create_an_environment.rst b/docs/grid2op_extend/create_an_environment.rst similarity index 100% rename from docs/developer/create_an_environment.rst rename to docs/grid2op_extend/create_an_environment.rst diff --git a/docs/developer/createbackend.rst b/docs/grid2op_extend/createbackend.rst similarity index 99% rename from docs/developer/createbackend.rst rename to docs/grid2op_extend/createbackend.rst index c1ecc86e..124925f8 100644 --- a/docs/developer/createbackend.rst +++ b/docs/grid2op_extend/createbackend.rst @@ -63,12 +63,12 @@ Objectives You will also find in this file the complete description on how the "powergrid" is represented in grid2op. Backend is an abstraction that represents the physical system (the powergrid). In theory every powerflow can be - used as a backend. And example of a backend using `Pandapower `_ is available with - the :class:`grid2op.Backend.EducPandaPowerBackend.EducPandaPowerBackend` (only for demonstration purpose) + used as a backend. And example of a backend using `Pandapower `__ is available with + the :class:`grid2op.Backend.educPandaPowerBackend.EducPandaPowerBackend` (only for demonstration purpose) If you want working backend, please use the :class:`grid2op.Backend.PandaPowerBackend` that - uses `Pandapower `_ and - a port in c++ to a subset of pandapower called `LightSim2Grid `_ . + uses `Pandapower `__ and + a port in c++ to a subset of pandapower called `LightSim2Grid `__ . To implement completely a backend, you should implement all the abstract function defined here :ref:`backend-module`. diff --git a/docs/developer/env_content.rst b/docs/grid2op_extend/env_content.rst similarity index 100% rename from docs/developer/env_content.rst rename to docs/grid2op_extend/env_content.rst diff --git a/docs/developer/final.rst b/docs/grid2op_extend/final.rst similarity index 100% rename from docs/developer/final.rst rename to docs/grid2op_extend/final.rst diff --git a/docs/developer/observation.rst b/docs/grid2op_extend/observation.rst similarity index 100% rename from docs/developer/observation.rst rename to docs/grid2op_extend/observation.rst diff --git a/docs/index.rst b/docs/index.rst index d6fc74dd..6cf59ea3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -202,7 +202,7 @@ but if you want to slightly modify one of its component. :maxdepth: 1 :caption: Technical documentation for grid2op "external" contributions - developer + grid2op_extend Technical documentation for grid2op developers diff --git a/docs/special.rst b/docs/special.rst index 5b210239..68ffebc5 100644 --- a/docs/special.rst +++ b/docs/special.rst @@ -1,6 +1,7 @@ .. Color profiles for Sphinx. .. Has to be used with hacks.css .. (https://bitbucket.org/lbesson/web-sphinx/src/master/.static/hacks.css) + .. role:: black .. role:: gray .. role:: grey @@ -38,4 +39,4 @@ .. role:: center .. role:: left .. role:: right -.. (c) Lilian Besson, 2011-2016, https://bitbucket.org/lbesson/web-sphinx/ \ No newline at end of file +.. (c) Lilian Besson, 2011-2016, https://bitbucket.org/lbesson/web-sphinx/ diff --git a/docs/user/opponent.rst b/docs/user/opponent.rst index 9f47edc9..0998a3d3 100644 --- a/docs/user/opponent.rst +++ b/docs/user/opponent.rst @@ -41,11 +41,12 @@ First, a grid is said to be "in security" if no threshold are violate for any eq In the context of grid2op, this most often means that all powerlines have a flow under a certain threshold (refer to as "thermal limit" in grid2op). -``̀` -A grid is N-1 safe, if, for any "contingency" (*eg* the disconnection a powerline) from -a given list (in general this list is "all the lines / transformers on the grid"), the grid would -still be "in security" (define in the above paragraph) after this contingency occurred. -``̀` +.. important:: + + A grid is N-1 safe, if, for any "contingency" (*eg* the disconnection a powerline) from + a given list (in general this list is "all the lines / transformers on the grid"), the grid would + still be "in security" (define in the above paragraph) after this contingency occurred. + N-1 with corrective actions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,11 +60,11 @@ contingency to avoid the grid to go out of security. This would give the following definition of N-1 security: -``̀` -A grid is N-1 secure (with corrective action), if an only if, for a any contingency (among a given list), -it is possible to find (at least) a corrective action (understand: an action that can be quickly implemented after -the contingency, including the "I do nothing action") that would bring the grid back to security. -``̀` +.. important:: + A grid is N-1 secure (with corrective action), if an only if, for a any contingency (among a given list), + it is possible to find (at least) a corrective action (understand: an action that can be quickly implemented after + the contingency, including the "I do nothing action") that would bring the grid back to security. + .. note:: If a grid is N-1 secure (as described in the above paragraph), it will be "N-1 secure (with corrective action)". @@ -78,11 +79,11 @@ or a few days). The N-1 criterion can then be "extended" to include the time dependance. The natural definition would be: -``̀` -A grid is N-1 scure accross the time interval [beginning, end] if (and only if), for any contingency -(among a given list) occurring during this time interval, there exists a list of corrective actions that -can ensure the grid remains in security at any time until the end of this interval". -``̀` +.. important:: + A grid is N-1 scure accross the time interval [beginning, end] if (and only if), for any contingency + (among a given list) occurring during this time interval, there exists a list of corrective actions that + can ensure the grid remains in security at any time until the end of this interval". + .. note:: If the grid state is not modified by any action, assessing whether or not the grid is "N-1 secure on a given time interval" diff --git a/docs/user/special.rst b/docs/user/special.rst index a4b7a9d9..8f668078 100644 --- a/docs/user/special.rst +++ b/docs/user/special.rst @@ -1,4 +1,5 @@ .. for the color + .. include:: ../special.rst .. _n_gen: ./space.html#grid2op.Space.GridObjects.n_gen diff --git a/grid2op/Action/baseAction.py b/grid2op/Action/baseAction.py index 2de4d095..150e5fce 100644 --- a/grid2op/Action/baseAction.py +++ b/grid2op/Action/baseAction.py @@ -216,13 +216,13 @@ class BaseAction(GridObjects): _subs_impacted: :class:`numpy.ndarray`, dtype:bool This attributes is either not initialized (set to ``None``) or it tells, for each substation, if it is impacted - by the action (in this case :attr:`BaseAction._subs_impacted`\[sub_id\] is ``True``) or not - (in this case :attr:`BaseAction._subs_impacted`\[sub_id\] is ``False``) + by the action (in this case :attr:`BaseAction._subs_impacted` \\[sub_id\\] is ``True``) or not + (in this case :attr:`BaseAction._subs_impacted` [sub_id] is ``False``) _lines_impacted: :class:`numpy.ndarray`, dtype:bool This attributes is either not initialized (set to ``None``) or it tells, for each powerline, if it is impacted - by the action (in this case :attr:`BaseAction._lines_impacted`\[line_id\] is ``True``) or not - (in this case :attr:`BaseAction._subs_impacted`\[line_id\] is ``False``) + by the action (in this case :attr:`BaseAction._lines_impacted` \\[line_id\\] is ``True``) or not + (in this case :attr:`BaseAction._subs_impacted` \\[line_id\\] is ``False``) attr_list_vect: ``list``, static The authorized key that are processed by :func:`BaseAction.__call__` to modify the injections @@ -630,6 +630,7 @@ def __init__(self, _names_chronics_to_backend: Optional[Dict[Literal["loads", "p #: .. versionadded:: 1.12.1 + #: #: allows the agent to perform an action #: that depends on the backend type used. #: See the doc for more information. @@ -652,7 +653,8 @@ def __init__(self, _names_chronics_to_backend: Optional[Dict[Literal["loads", "p self._modif_detach_storage = False #: .. versionadded:: 1.12.1 - #: cache not to recompute the `is_ambiguous` for the same action + #: + #: cache not to recompute the :attr:`BaseAction.is_ambiguous` for the same action self._cached_is_not_ambiguous = True # init the private argument when needed @@ -1618,10 +1620,15 @@ def _aux_eq_shunts(self, other: "BaseAction") -> bool: def _aux_vect_different(self, other, modif_flag_nm, vect_nm): """Implement something similar to : - ((self._modif_set_status != other._modif_set_status) or - not np.all(self._set_line_status == other._set_line_status) - ) + .. code-block:: python + + ((self._modif_set_status != other._modif_set_status) or + not np.all(self._set_line_status == other._set_line_status) + ) + But for different flag (*eg* `_modif_set_status`) and vector (*eg* `_private_set_line_status`) + to avoid duplicating the code. + """ if getattr(self, modif_flag_nm) != getattr(other, modif_flag_nm): # they are different @@ -1908,7 +1915,7 @@ def get_topological_impact(self, then the argument `powerline_status` might be ignored in future calls where `_read_from_cache` is ``True`` - .. newinversion:: 1.11.0 + .. versionadded:: 1.11.0 .. warning:: Use with extra care, it's private API. @@ -1925,7 +1932,7 @@ def get_topological_impact(self, By default it's ``True``, but by default no cache is not set up. This means that by default the argument `powerline_status` is in fact used. - .. newinversion:: 1.11.0 + .. versionadded:: 1.11.0 Returns ------- diff --git a/grid2op/Backend/educPandaPowerBackend.py b/grid2op/Backend/educPandaPowerBackend.py index b8820272..1b370c17 100644 --- a/grid2op/Backend/educPandaPowerBackend.py +++ b/grid2op/Backend/educPandaPowerBackend.py @@ -40,7 +40,7 @@ class EducPandaPowerBackend(Backend): resulting backend harder to read. This module presents an example of an implementation of a `grid2op.Backend` when using the powerflow - implementation "pandapower" available at `PandaPower `_ for more details about + implementation "pandapower" available at `PandaPower `__ for more details about this backend. This file is provided as an example of a proper :class:`grid2op.Backend.Backend` implementation. This backend currently does not work with 3 winding transformers and other exotic object. diff --git a/grid2op/Backend/pandaPowerBackend.py b/grid2op/Backend/pandaPowerBackend.py index 9c956ea5..e93b800b 100644 --- a/grid2op/Backend/pandaPowerBackend.py +++ b/grid2op/Backend/pandaPowerBackend.py @@ -52,7 +52,7 @@ class PandaPowerBackend(Backend): of PandaPower. This module presents an example of an implementation of a `grid2op.Backend` when using the powerflow - implementation "pandapower" available at `PandaPower `_ for more details about + implementation "pandapower" available at `PandaPower `__ for more details about this backend. This file is provided as an example of a proper :class:`grid2op.Backend.Backend` implementation. This backend currently does not work with 3 winding transformers and other exotic object. diff --git a/grid2op/Environment/baseEnv.py b/grid2op/Environment/baseEnv.py index 23dba6e5..e3699df9 100644 --- a/grid2op/Environment/baseEnv.py +++ b/grid2op/Environment/baseEnv.py @@ -171,10 +171,6 @@ def foo(manager): Attributes ---------- - - parameters: :class:`grid2op.Parameters.Parameters` - The parameters of the game (to expose more control on what is being simulated) - with_forecast: ``bool`` Whether the chronics allow to have some kind of "forecast". See :func:`BaseEnv.activate_forceast` for more information @@ -318,7 +314,9 @@ def foo(manager): kwargs_observation: ``dict`` TODO - # TODO add the units (eg MW, MWh, MW/time step,etc.) in the redispatching related attributes + warnings + -------- + TODO add the units (eg MW, MWh, MW/time step,etc.) in the redispatching related attributes """ ALARM_FILE_NAME = "alerts_info.json" diff --git a/grid2op/Observation/baseObservation.py b/grid2op/Observation/baseObservation.py index 2764375c..1b75e20d 100644 --- a/grid2op/Observation/baseObservation.py +++ b/grid2op/Observation/baseObservation.py @@ -264,6 +264,19 @@ class BaseObservation(GridObjects): non renewable generators) This is NOT the "curtailment" given in the action by the agent. + + This "effective curtailment" is expressed in MW rather than in ratio of pmax. + + Examples + -------- + .. code-block:: python + + import grid2op + env_name = "l2rpn_case14_sandbox" # or any other name + env = grid2op.make(env_name) + + obs = env.reset() + curtailment_mw = obs.curtailment_mw curtailment: :class:`numpy.ndarray`, dtype:float Give the power curtailed for each generator. It is expressed in @@ -4333,21 +4346,6 @@ def thermal_limit(self) -> np.ndarray: @property def curtailment_mw(self) -> np.ndarray: - """ - return the curtailment, expressed in MW rather than in ratio of pmax. - - Examples - -------- - .. code-block:: python - - import grid2op - env_name = "l2rpn_case14_sandbox" # or any other name - env = grid2op.make(env_name) - - obs = env.reset() - curtailment_mw = obs.curtailment_mw - - """ return self.curtailment * self.gen_pmax @property From 70c86b9f155ecd773566f01abd9291856d229452 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Thu, 20 Nov 2025 11:41:55 +0100 Subject: [PATCH 03/16] fix some issues in the docstrings Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 5 +++- docs/conf.py | 5 ++-- grid2op/Action/baseAction.py | 47 ++++++++++++++++++------------------ 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ee9accdf..3794dcf0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -102,7 +102,10 @@ Native multi agents support: [1.12.3] ----------------------- - +- [FIXED] the warnings when building the documentation. +- [FIXED] the deprecation warnings when importing grid2op + with recent python versions (due to presence of math equation + in some docstring) [1.12.2] - 2025-11-18 ---------------------- diff --git a/docs/conf.py b/docs/conf.py index d9ef0c2f..e78a0908 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,14 +35,15 @@ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', - 'sphinx.ext.imgmath', + 'sphinx.ext.imgmath', # for math in documentation 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', # 'builder', 'sphinx.ext.extlinks', 'sphinx.ext.napoleon', 'sphinxcontrib_trio', - "sphinx_rtd_theme", + "sphinx_rtd_theme", + # 'sphinx.ext.mathjax', # toc of modules 'autodocsumm', # 'sphinx.ext.autosectionlabel', diff --git a/grid2op/Action/baseAction.py b/grid2op/Action/baseAction.py index 150e5fce..086ac65b 100644 --- a/grid2op/Action/baseAction.py +++ b/grid2op/Action/baseAction.py @@ -216,13 +216,13 @@ class BaseAction(GridObjects): _subs_impacted: :class:`numpy.ndarray`, dtype:bool This attributes is either not initialized (set to ``None``) or it tells, for each substation, if it is impacted - by the action (in this case :attr:`BaseAction._subs_impacted` \\[sub_id\\] is ``True``) or not + by the action (in this case :attr:`BaseAction._subs_impacted` [sub_id] is ``True``) or not (in this case :attr:`BaseAction._subs_impacted` [sub_id] is ``False``) _lines_impacted: :class:`numpy.ndarray`, dtype:bool This attributes is either not initialized (set to ``None``) or it tells, for each powerline, if it is impacted - by the action (in this case :attr:`BaseAction._lines_impacted` \\[line_id\\] is ``True``) or not - (in this case :attr:`BaseAction._subs_impacted` \\[line_id\\] is ``False``) + by the action (in this case :attr:`BaseAction._lines_impacted` [line_id] is ``True``) or not + (in this case :attr:`BaseAction._subs_impacted` [line_id] is ``False``) attr_list_vect: ``list``, static The authorized key that are processed by :func:`BaseAction.__call__` to modify the injections @@ -1696,18 +1696,18 @@ def __eq__(self, other: "BaseAction") -> bool: Test the equality of two actions. 2 actions are said to be identical if they have the same impact on the powergrid. This is unrelated to their - respective class. For example, if an Action is of class :class:`Action` and doesn't act on the injection, it + respective class. For example, if an Action is of class :class:`BaseAction` and doesn't act on the injection, it can be equal to an Action of the derived class :class:`TopologyAction` (if the topological modifications are the same of course). - This implies that the attributes :attr:`Action.authorized_keys` is not checked in this method. + This implies that the attributes :attr:`BaseAction.authorized_keys` is not checked in this method. Note that if 2 actions don't act on the same powergrid, or on the same backend (eg number of loads, or generators are not the same in *self* and *other*, or they are not in the same order) then action will be declared as different. **Known issue** if two backends are different, but the description of the _grid are identical (ie all - n_gen, n_load, n_line, sub_info, dim_topo, all vectors \*_to_subid, and \*_pos_topo_vect are + n_gen, n_load, n_line, sub_info, dim_topo, all vectors \\*_to_subid, and \\*_pos_topo_vect are identical) then this method will not detect the backend are different, and the action could be declared as identical. For now, this is only a theoretical behavior: if everything is the same, then probably, up to the naming convention, then the power grids are identical too. @@ -5594,9 +5594,9 @@ def set_bus(self) -> np.ndarray: Will: - * set to bus 1 the (unique) element for which \*_pos_topo_vect is 1 - * disconnect the (unique) element for which \*_pos_topo_vect is 2 - * set to bus 2 the (unique) element for which \*_pos_topo_vect is 3 + * set to bus 1 the (unique) element for which \\*_pos_topo_vect is 1 + * disconnect the (unique) element for which \\*_pos_topo_vect is 2 + * set to bus 2 the (unique) element for which \\*_pos_topo_vect is 3 You can use the documentation page :ref:`modeled-elements-module` for more information about which element correspond to what component of this vector. @@ -5916,9 +5916,9 @@ def change_bus(self) -> np.ndarray: Will: - * change the bus of the (unique) element for which \*_pos_topo_vect is 1 - * change the bus of (unique) element for which \*_pos_topo_vect is 2 - * change the bus of (unique) element for which \*_pos_topo_vect is 3 + * change the bus of the (unique) element for which \\*_pos_topo_vect is 1 + * change the bus of (unique) element for which \\*_pos_topo_vect is 2 + * change the bus of (unique) element for which \\*_pos_topo_vect is 3 You can use the documentation page :ref:`modeled-elements-module` for more information about which element correspond to what component of this "vector". @@ -7426,7 +7426,7 @@ def limit_curtail_storage(self, margin: float=10., do_copy: bool=False, _tol_equal : float=0.01) -> Tuple["BaseAction", np.ndarray, np.ndarray]: - """ + r""" This function tries to limit the possibility to end up with a "game over" because actions on curtailment or storage units (see the "Notes" section for more information). @@ -7449,25 +7449,26 @@ def limit_curtail_storage(self, At each time, the environment ensures that the following equations are met: - 1) for each controlable generators $p^{(c)}_{min} <= p^{(c)}_t <= p^{(c)}_{max}$ - 2) for each controlable generators $-ramp_{min}^{(c)} <= p^{(c)}_t - p^{(c)}_{t-1} <= ramp_{max}^{(c)}$ + 1) for each controlable generators :math:`p^{(c)}_{min} <= p^{(c)}_t <= p^{(c)}_{max}` + 2) for each controlable generators :math:`-ramp_{min}^{(c)} <= p^{(c)}_t - p^{(c)}_{t-1} <= ramp_{max}^{(c)}` 3) at each step the sum of MW curtailed and the total contribution of storage units is absorbed by the controlable generators so that the total amount of power injected at this step does not change: - $\sum_{\text{all generators } g} p^{(g, scenario)}_t = \sum_{\text{controlable generators } c} p^{(c)}_t + \sum_{\text{storage unit } s} p^{s}_t + \sum_{\text{renewable generator} r} p^{(r)}_t$ - where $p^{(g)}_t$ denotes the productions of generator $g$ in the input data "scenario" + :math:`\sum_{\text{all generators } g} p^{(g, scenario)}_t = \sum_{\text{controlable generators } c} p^{(c)}_t + \sum_{\text{storage unit } s} p^{s}_t + \sum_{\text{renewable generator} r} p^{(r)}_t` + where :math:`p^{(g)}_t` denotes the productions of generator $g$ in the input data "scenario" (*ie* "in the current episode", "before any modification", "decided by the market / central authority"). - In the above equations, `\sum_{\text{storage unit } s} p^{s}_t` are controled by the action (thanks to the storage units) - and `\sum_{\text{renewable generator} r} p^{(r)}_t` are controlled by the curtailment. + In the above equations: + ..:math:`\sum_{\text{storage unit } s} p^{s}_t` are controled by the action (thanks to the storage units) + and :math:`\sum_{\text{renewable generator} r} p^{(r)}_t` are controlled by the curtailment. - `\sum_{\text{all generators } g} p^{(g, scenario)}_t` are input data from the environment (that cannot be modify). + :math:`\sum_{\text{all generators } g} p^{(g, scenario)}_t` are input data from the environment (that cannot be modify). - The exact value of each `p^{(c)}_t` (for each controlable generator) is computed by an internal routine of the + The exact value of each :math:`p^{(c)}_t` (for each controlable generator) is computed by an internal routine of the environment. - The constraint comes from the fact that `\sum_{\text{controlable generators } c} p^{(c)}_t` is determined by the last equation - above but at the same time the values of each `p^{(c)}_t` (for each controllable generator) is heavily constrained + The constraint comes from the fact that :math:`\sum_{\text{controlable generators } c} p^{(c)}_t` is determined by the last equation + above but at the same time the values of each :math:`p^{(c)}_t` (for each controllable generator) is heavily constrained by equations 1) and 2). .. note:: From cc7ce09aeaa9d2f0dfdd60da88701d4ebd074808 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Mon, 2 Feb 2026 12:06:51 +0100 Subject: [PATCH 04/16] improve code for AAA tests on backend Signed-off-by: DONNOT Benjamin --- grid2op/tests/BaseBackendTest.py | 10 +++++----- grid2op/tests/aaa_test_backend_interface.py | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/grid2op/tests/BaseBackendTest.py b/grid2op/tests/BaseBackendTest.py index 071d7e21..f2915f93 100644 --- a/grid2op/tests/BaseBackendTest.py +++ b/grid2op/tests/BaseBackendTest.py @@ -2237,9 +2237,9 @@ def test_shunt_effect(self): env_change_q.action_space({"shunt": {"set_bus": [(0, 2)]}}) ) assert obs_co_bus2_sh_alone._shunt_bus == -1 - assert obs_co_bus2_sh_alone._shunt_v == 0. - assert obs_co_bus2_sh_alone._shunt_p == 0 - assert obs_co_bus2_sh_alone._shunt_q == 0 + assert np.abs(obs_co_bus2_sh_alone._shunt_v - 0.) <= 1e-6 + assert np.abs(obs_co_bus2_sh_alone._shunt_p - 0.) <= 1e-6 + assert np.abs(obs_co_bus2_sh_alone._shunt_q - 0.) <= 1e-6 # note that above the backend can diverge (shunt is alone on its bus !) # on pp it does not ... but it probably should @@ -2256,8 +2256,8 @@ def test_shunt_effect(self): assert np.allclose(obs_co_bus2_sh_notalone.v_or[10], 23.15359878540039) assert obs_co_bus2_sh_notalone._shunt_bus == 2 assert np.allclose(obs_co_bus2_sh_notalone._shunt_v, 23.15359878540039) - assert obs_co_bus2_sh_notalone._shunt_p == 0 - assert obs_co_bus2_sh_notalone._shunt_q == -25.464233 + assert np.abs(obs_co_bus2_sh_notalone._shunt_p) <= 1e-6, f"{obs_co_bus2_sh_notalone._shunt_p} vs 0." + assert np.abs(obs_co_bus2_sh_notalone._shunt_q - -25.464233) <= 1e-6 class BaseTestResetEqualsLoadGrid(MakeBackend): diff --git a/grid2op/tests/aaa_test_backend_interface.py b/grid2op/tests/aaa_test_backend_interface.py index c11f86f3..6e3841ce 100644 --- a/grid2op/tests/aaa_test_backend_interface.py +++ b/grid2op/tests/aaa_test_backend_interface.py @@ -724,10 +724,10 @@ def test_14change_topology(self): assert np.allclose(diff_v_bus, 0., atol=3 * self.tol_one), "there are some discrepency in the backend after a powerflow: some nodes have two different voltages. Check the accessor for voltage in all the `***_info()` (*eg* `loads_info()`)" p_after_or, q_after_or, v_after_or, a_after_or = backend.lines_or_info() - assert np.allclose(p_after_or, p_or), f"The p_or flow changed while the topology action is supposed to have no impact, check the `apply_action` for topology" - assert np.allclose(q_after_or, q_or), f"The q_or flow changed while the topology action is supposed to do nothing, check the `apply_action` for topology" - assert np.allclose(v_after_or, v_or), f"The v_or changed while the topology action is supposed to do nothing, check the `apply_action` for topology" - assert np.allclose(a_after_or, a_or), f"The a_or flow changed while the topology action is supposed to do nothing, check the `apply_action` for topology" + assert np.allclose(p_after_or, p_or), "The p_or flow changed while the topology action is supposed to have no impact, check the `apply_action` for topology" + assert np.allclose(q_after_or, q_or), "The q_or flow changed while the topology action is supposed to do nothing, check the `apply_action` for topology" + assert np.allclose(v_after_or, v_or), "The v_or changed while the topology action is supposed to do nothing, check the `apply_action` for topology" + assert np.allclose(a_after_or, a_or), "The a_or flow changed while the topology action is supposed to do nothing, check the `apply_action` for topology" sub_id = 1 # mix of bus 1 and 2 on substation 1 @@ -750,10 +750,10 @@ def test_14change_topology(self): assert np.allclose(diff_v_bus, 0., atol=3 * self.tol_one), "there are some discrepency in the backend after a powerflow: some nodes have two different voltages. Check the accessor for voltage in all the `***_info()` (*eg* `loads_info()`)" p_after_or, q_after_or, v_after_or, a_after_or = backend.lines_or_info() - assert not np.allclose(p_after_or, p_or), f"The p_or flow doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" - assert not np.allclose(q_after_or, q_or), f"The q_or flow doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" - assert not np.allclose(v_after_or, v_or), f"The v_or doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" - assert not np.allclose(a_after_or, a_or), f"The a_or flow doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" + assert not np.allclose(p_after_or, p_or), "The p_or flow doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" + assert not np.allclose(q_after_or, q_or), "The q_or flow doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" + assert not np.allclose(v_after_or, v_or), "The v_or doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" + assert not np.allclose(a_after_or, a_or), "The a_or flow doesn't change while the topology action is supposed to have a real impact, check the `apply_action` for topology" def test_15_reset(self): """Tests that when a backend is reset, it is indeed reset in the original state From 610d9d1f911756e503bcc215f5dbc3763fe805be Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Mon, 2 Feb 2026 12:08:49 +0100 Subject: [PATCH 05/16] fix a bug preventing to load a grid with disconnected elements Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 8 ++++++-- grid2op/Action/_backendAction.py | 2 +- grid2op/Backend/backend.py | 13 ++++++------- grid2op/Environment/_env_prev_state.py | 21 +++++++++++++++++++++ grid2op/Environment/baseEnv.py | 6 +++--- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3794dcf0..40853371 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -106,6 +106,10 @@ Native multi agents support: - [FIXED] the deprecation warnings when importing grid2op with recent python versions (due to presence of math equation in some docstring) +- [FIXED] issues when loading a grid with disconnected elements: grid2op + did not know on which bus to reconnect them when only the "reconnect" bus was given. +- [IMPROVED] code for AAA backend tests + [1.12.2] - 2025-11-18 ---------------------- @@ -1176,8 +1180,8 @@ Native multi agents support: - [ADDED]: a new kind of opponent that is able to attack at "more random" times with "more random" duration. See the `GeometricOpponent`. - [IMPROVED]: on windows at least, grid2op does not work with gym < 0.17.2 Checks are performed in order to make sure - the installed open ai gym package meets this requirement (see issue - `Issue#185 `_ ) + the installed open ai gym package meets this requirement + (see issue `Issue#185 `_ ) - [IMPROVED] the seed of openAI gym for composed action space (see issue `https://github.com/openai/gym/issues/2166`): in waiting for an official fix, grid2op will use the solution proposed there https://github.com/openai/gym/issues/2166#issuecomment-803984619 diff --git a/grid2op/Action/_backendAction.py b/grid2op/Action/_backendAction.py index 1aafe621..ab6d7223 100644 --- a/grid2op/Action/_backendAction.py +++ b/grid2op/Action/_backendAction.py @@ -245,7 +245,7 @@ def __getitem__(self, item): def __iter__(self): return self - + def __next__(self): res = None while self.last_index < self.values.shape[0]: diff --git a/grid2op/Backend/backend.py b/grid2op/Backend/backend.py index 6bb872cb..b2ea26df 100644 --- a/grid2op/Backend/backend.py +++ b/grid2op/Backend/backend.py @@ -192,7 +192,7 @@ def __init__(self, self.detachment_is_allowed : bool = DEFAULT_ALLOW_DETACHMENT #: .. versionadded: 1.11.0 - self._load_bus_target : Optional[np.ndarray]= None + self._load_bus_target : Optional[np.ndarray] = None self._gen_bus_target : Optional[np.ndarray] = None self._storage_bus_target : Optional[np.ndarray] = None self._shunt_bus_target : Optional[np.ndarray] = None @@ -491,7 +491,6 @@ def apply_action_public(self, backend_action: Union["_BackendAction", None]) -> self._shunt_bus_target.flags.writeable = True self._shunt_bus_target[shunts_bus.changed] = shunts_bus.values[shunts_bus.changed] self._shunt_bus_target.flags.writeable = False - return self.apply_action(backend_action) def update_bus_target_after_pf(self, loads_bus, gens_bus, stos_bus, shunt_bus=None): @@ -2208,12 +2207,12 @@ def get_action_to_set(self) -> "CompleteAction": set_me = self._complete_action_class() # pylint: disable=not-callable dict_ = { "set_line_status": line_status, - "set_bus": 1 * topo_vect, + "set_bus": topo_vect.copy(), "injection": { - "prod_p": prod_p, - "prod_v": prod_v, - "load_p": load_p, - "load_q": load_q, + "prod_p": prod_p.copy(), + "prod_v": prod_v.copy(), + "load_p": load_p.copy(), + "load_q": load_q.copy(), }, } diff --git a/grid2op/Environment/_env_prev_state.py b/grid2op/Environment/_env_prev_state.py index 34a5a521..b109b243 100644 --- a/grid2op/Environment/_env_prev_state.py +++ b/grid2op/Environment/_env_prev_state.py @@ -211,3 +211,24 @@ def _aux_update(self, arr1[el_co] = 1. * arr1_new[el_co] if arr2 is not None: arr2[el_co] = 1. * arr2_new[el_co] + + + def fix_topo_bus(self): + """ + This function fixes the "previous connection sate" to make sure they are all valid buses for set_bus. + + There might be issues for example if the original grid contained disconnected elements, in that case they would + be assigned to 0 which is not possible. + + """ + if (self._topo_vect != 1).all(): + # all bus are >= ok + return + + # if detailed topo, not done ATM # TODO + if hasattr(self, "_switch_state") and self._switch_state is not None: + raise RuntimeError() + + self._topo_vect[self._topo_vect <= -2] = -1 + self._topo_vect[self._topo_vect == 0] = -1 + self._topo_vect[self._topo_vect >= int(self._grid_obj_cls["n_busbar_per_sub"])] = 1 diff --git a/grid2op/Environment/baseEnv.py b/grid2op/Environment/baseEnv.py index e3699df9..7d6e9f0a 100644 --- a/grid2op/Environment/baseEnv.py +++ b/grid2op/Environment/baseEnv.py @@ -1522,16 +1522,16 @@ def _has_been_initialized(self): # nothing to do in this case self.logger.warning(f"Impossible to retrieve the initial state of the grid before running the initial powerflow: {exc_}") self._previous_conn_state._topo_vect[:] = 1 # I force assign everything to busbar 1 by default... - self._cst_prev_state_at_init = copy.deepcopy(self._previous_conn_state) self._backend_action = self._backend_action_class() else: # environment initialized from an observation, eg forecast_env # update the backend self._backend_action = self.backend.update_from_obs(self._init_obs) self._backend_action.last_topo_registered.values[:] = self._init_obs._prev_conn._topo_vect - self._cst_prev_state_at_init = copy.deepcopy(self._init_obs._prev_conn) self._previous_conn_state.update_from_other(self._init_obs._prev_conn) - + + self._previous_conn_state.fix_topo_bus() + self._cst_prev_state_at_init = self._previous_conn_state.copy() self._cst_prev_state_at_init.prevent_modification() # update backend_action with the "last known" state self._backend_action.last_topo_registered.values[:] = self._previous_conn_state._topo_vect From 35675754ccb5e8d98b592c6bfc7ae328801c9d55 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Mon, 2 Feb 2026 17:41:37 +0100 Subject: [PATCH 06/16] improve consistency if grid is loaded with disconnected elements Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 2 +- docs/user/action.rst | 11 + grid2op/Action/_backendAction.py | 2 +- grid2op/Action/baseAction.py | 43 + grid2op/Backend/pandaPowerBackend.py | 25 +- grid2op/Environment/_env_prev_state.py | 21 +- grid2op/Environment/baseEnv.py | 21 +- grid2op/Environment/environment.py | 9 +- .../5bus_example.json | 1339 +++++++++++++ .../chronics/0/hazards.csv.bz2 | Bin 0 -> 84 bytes .../chronics/0/load_p.csv.bz2 | Bin 0 -> 2599 bytes .../chronics/0/load_p_forecasted.csv.bz2 | Bin 0 -> 1073 bytes .../chronics/0/load_q.csv.bz2 | Bin 0 -> 2023 bytes .../chronics/0/load_q_forecasted.csv.bz2 | Bin 0 -> 912 bytes .../chronics/0/maintenance.csv.bz2 | Bin 0 -> 84 bytes .../chronics/0/maintenance_forecasted.csv.bz2 | Bin 0 -> 84 bytes .../chronics/0/maintenance_meta.json | 7 + .../chronics/0/prod_p.csv.bz2 | Bin 0 -> 3326 bytes .../chronics/0/prod_p_forecasted.csv.bz2 | Bin 0 -> 3095 bytes .../chronics/0/prod_v.csv.bz2 | Bin 0 -> 78 bytes .../chronics/0/prod_v_forecasted.csv.bz2 | Bin 0 -> 83 bytes .../5bus_example_disco_el_in_grid/config.py | 19 + .../5bus_example_disco_el_in_grid/grid.json | 1772 +++++++++++++++++ .../prods_charac.csv | 3 + grid2op/tests/test_previous_state.py | 135 ++ 25 files changed, 3384 insertions(+), 25 deletions(-) create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/5bus_example.json create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/hazards.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_p.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_p_forecasted.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_q.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_q_forecasted.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_forecasted.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_meta.json create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_p.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_p_forecasted.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_v.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_v_forecasted.csv.bz2 create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/config.py create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/grid.json create mode 100644 grid2op/data_test/5bus_example_disco_el_in_grid/prods_charac.csv diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 40853371..ff3014f7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -109,7 +109,7 @@ Native multi agents support: - [FIXED] issues when loading a grid with disconnected elements: grid2op did not know on which bus to reconnect them when only the "reconnect" bus was given. - [IMPROVED] code for AAA backend tests - +- [IMPROVED] doc when loading grid with disconnected elements [1.12.2] - 2025-11-18 ---------------------- diff --git a/docs/user/action.rst b/docs/user/action.rst index aa23bd58..1f9f0bb2 100644 --- a/docs/user/action.rst +++ b/docs/user/action.rst @@ -453,6 +453,17 @@ action original status final status \* means that this bus is affected: if it was on bus 1 it moves on bus 2 and vice versa. +.. danger:: + In the general case, the "last state" (denoted `PREVIOUS_OR` or `PREVIOUS_EX`) is known. But it is not always the case. + + It can happen that the original grid file (the one loaded by grid2op backend to create the environment) has + disconnected elements. + + In this case, it is NOT possible to reconnect said elements without provided explicitely the buses at both sides. Any + attempt to do so will lead to a "illegal" action and will be replaced by "do nohting" in env.step (thus discarding all other + "parts" of the action). + + Note on random actions ------------------------ Sampling a "non ambiguous" legal action is a difficult task. diff --git a/grid2op/Action/_backendAction.py b/grid2op/Action/_backendAction.py index ab6d7223..d2479bd0 100644 --- a/grid2op/Action/_backendAction.py +++ b/grid2op/Action/_backendAction.py @@ -910,7 +910,7 @@ def __iadd__(self, other : BaseAction) -> Self: # V Force disconnected status # of disconnected powerlines extremities self._status_or[:], self._status_ex[:] = self.current_topo.get_line_status( - self.line_or_pos_topo_vect, self.line_ex_pos_topo_vect + cls.line_or_pos_topo_vect, cls.line_ex_pos_topo_vect ) # At least one disconnected extremity diff --git a/grid2op/Action/baseAction.py b/grid2op/Action/baseAction.py index 086ac65b..a32c7af5 100644 --- a/grid2op/Action/baseAction.py +++ b/grid2op/Action/baseAction.py @@ -7954,3 +7954,46 @@ def has_element_detached(self): `detach_load`, `detach_gen` or `detach_storage` """ return self._modif_detach_gen or self._modif_detach_load or self._modif_detach_storage + + def check_reconnection_valid(self, current_line_status, last_valid_topo_vect): + # check lines can be reconnected safely if no bus is provided + if not (self._modif_set_status or self._modif_change_status): + return None + cls = type(self) + + # line reconnected + reco = ((self._set_line_status == 1) | + (self._switch_line_status & (~current_line_status))) + + # # line reconnected without topology + # if self._modif_set_bus: + # reco_without_bus = reco.copy() + # reco_without_bus[self._set_topo_vect[cls.line_or_pos_topo_vect] >= 1] = False + # reco_without_bus[self._set_topo_vect[cls.line_ex_pos_topo_vect] >= 1] = False + # else: + # reco_without_bus = reco + + # check that the "previous bus" is known for these lines + vect_or = cls.line_or_pos_topo_vect[reco] + vect_ex = cls.line_ex_pos_topo_vect[reco] + if not self._modif_set_bus: + # reconnection without proper bus specified in the action + # previous bus should be registered at both ends + issue_or = last_valid_topo_vect[vect_or] < 1 + issue_ex = last_valid_topo_vect[vect_ex] < 1 + else: + # check that the user specified the bus on each side + issue_or = (last_valid_topo_vect[vect_or] < 1) & (self._set_topo_vect[vect_or] < 1) + issue_ex = (last_valid_topo_vect[vect_ex] < 1) & (self._set_topo_vect[vect_ex] < 1) + if issue_or.any(): + return IllegalAction(f"Attempt to reconnect line " + f"{cls.name_line[issue_or.nonzero()[0]]} " + f"with id(s) {issue_or.nonzero()[0]} " + f"(origin side) with no known previous nodes. In this case, you need to specify " + f"explicitly the node / bus to which you want to reconnect it.") + if issue_ex.any(): + return IllegalAction(f"Attempt to reconnect line " + f"{cls.name_line[issue_ex.nonzero()[0]]} " + f"with id(s) {issue_ex.nonzero()[0]} " + f"(extremity side) with no known previous nodes. In this case, you need to specify " + f"explicitly the node / bus to which you want to reconnect it.") \ No newline at end of file diff --git a/grid2op/Backend/pandaPowerBackend.py b/grid2op/Backend/pandaPowerBackend.py index e93b800b..183d8aae 100644 --- a/grid2op/Backend/pandaPowerBackend.py +++ b/grid2op/Backend/pandaPowerBackend.py @@ -370,7 +370,7 @@ def load_grid(self, warnings.filterwarnings("ignore", category=FutureWarning) self._grid = pp.from_json(full_path) self._check_for_non_modeled_elements() - + # add the slack bus that is often not modeled as a generator, but i need it for this backend to work bus_gen_added = None i_ref = None @@ -452,13 +452,17 @@ def load_grid(self, self.__nb_powerline = self._grid.line.shape[0] self._init_bus_load = self.cst_1 * self._grid.load["bus"].values self._init_bus_gen = self.cst_1 * self._grid.gen["bus"].values - self._init_bus_lor = self.cst_1 * self._grid.line["from_bus"].values - self._init_bus_lex = self.cst_1 * self._grid.line["to_bus"].values - + + bus_lor = self.cst_1 * self._grid.line["from_bus"].values + # bus_lor[~self._grid.line["in_service"].values] = -1 + bus_lex = self.cst_1 * self._grid.line["to_bus"].values + # bus_lex[~self._grid.line["in_service"].values] = -1 t_for = self.cst_1 * self._grid.trafo["hv_bus"].values + # t_for[~self._grid.trafo["in_service"].values] = -1 t_fex = self.cst_1 * self._grid.trafo["lv_bus"].values - self._init_bus_lor = np.concatenate((self._init_bus_lor, t_for)).astype(dt_int) - self._init_bus_lex = np.concatenate((self._init_bus_lex, t_fex)).astype(dt_int) + # t_fex[~self._grid.trafo["in_service"].values] = -1 + self._init_bus_lor = np.concatenate((bus_lor, t_for)).astype(dt_int) + self._init_bus_lex = np.concatenate((bus_lex, t_fex)).astype(dt_int) self._grid["ext_grid"]["va_degree"] = 0.0 @@ -844,6 +848,7 @@ def _init_private_attrs(self) -> None: self.gen_theta = np.full(self.n_gen, fill_value=np.nan, dtype=dt_float) self.storage_theta = np.full(self.n_storage, fill_value=np.nan, dtype=dt_float) + self._get_line_status() self._get_topo_vect() self.tol = 1e-5 # this is NOT the pandapower tolerance !!!! this is used to check if a storage unit # produce / absorbs anything @@ -866,6 +871,7 @@ def storage_deact_for_backward_comaptibility(self) -> None: self._topo_vect.flags.writeable = True self._topo_vect.resize(cls.dim_topo, refcheck=False) self._topo_vect.flags.writeable = False + self._get_line_status() self._get_topo_vect() def _convert_id_topo(self, id_big_topo): @@ -966,12 +972,13 @@ def apply_action(self, backend_action: "grid2op.Action._backendAction._BackendAc # i made at least a real change, so i implement it in the backend for id_el, new_bus in topo__: id_el_backend, id_topo, type_obj = self._big_topo_to_backend[id_el] - if type_obj is not None: # storage unit are handled elsewhere self._type_to_bus_set[type_obj](new_bus, id_el_backend, id_topo) - - self._topo_vect.flags.writeable = False + + # self._topo_vect.flags.writeable = True + # self._topo_vect[topo__.changed] = topo__.values[topo__.changed] + # self._topo_vect.flags.writeable = False def _apply_load_bus(self, new_bus, id_el_backend, id_topo): new_bus_backend = type(self).local_bus_to_global_int( diff --git a/grid2op/Environment/_env_prev_state.py b/grid2op/Environment/_env_prev_state.py index b109b243..5df868ac 100644 --- a/grid2op/Environment/_env_prev_state.py +++ b/grid2op/Environment/_env_prev_state.py @@ -215,20 +215,31 @@ def _aux_update(self, def fix_topo_bus(self): """ - This function fixes the "previous connection sate" to make sure they are all valid buses for set_bus. + INTERNAL + + .. warning:: /!\\\\ Internal, do not use unless you know what you are doing /!\\\\ + + + This function fixes the "previous connection sate" to make sure they are all valid buses for set_bus. + + It is called by "env.reset" There might be issues for example if the original grid contained disconnected elements, in that case they would be assigned to 0 which is not possible. """ - if (self._topo_vect != 1).all(): - # all bus are >= ok + if not ((self._topo_vect <= -2) | + (self._topo_vect == 0) | + (self._topo_vect > int(self._grid_obj_cls["n_busbar_per_sub"])) + ).any(): + # all bus are ok + # nothing to do return # if detailed topo, not done ATM # TODO if hasattr(self, "_switch_state") and self._switch_state is not None: - raise RuntimeError() + raise RuntimeError("Disconnected element in the grid in the presence of switches. This is not handled at the moment.") self._topo_vect[self._topo_vect <= -2] = -1 self._topo_vect[self._topo_vect == 0] = -1 - self._topo_vect[self._topo_vect >= int(self._grid_obj_cls["n_busbar_per_sub"])] = 1 + self._topo_vect[self._topo_vect > int(self._grid_obj_cls["n_busbar_per_sub"])] = 1 diff --git a/grid2op/Environment/baseEnv.py b/grid2op/Environment/baseEnv.py index 7d6e9f0a..dd34cd00 100644 --- a/grid2op/Environment/baseEnv.py +++ b/grid2op/Environment/baseEnv.py @@ -1527,14 +1527,17 @@ def _has_been_initialized(self): # environment initialized from an observation, eg forecast_env # update the backend self._backend_action = self.backend.update_from_obs(self._init_obs) - self._backend_action.last_topo_registered.values[:] = self._init_obs._prev_conn._topo_vect + # self._backend_action.last_topo_registered.values[:] = self._init_obs._prev_conn._topo_vect self._previous_conn_state.update_from_other(self._init_obs._prev_conn) - + + # "fix" topology in case of disconnected element in grid file self._previous_conn_state.fix_topo_bus() self._cst_prev_state_at_init = self._previous_conn_state.copy() self._cst_prev_state_at_init.prevent_modification() + # update backend_action with the "last known" state self._backend_action.last_topo_registered.values[:] = self._previous_conn_state._topo_vect + self._backend_action.current_topo.values[:] = self._previous_conn_state._topo_vect self._backend_action._needs_active_bus = self.backend._needs_active_bus def _update_parameters(self): @@ -3412,13 +3415,13 @@ def _aux_register_env_converged(self, self._delta_gen_p[gen_detached_user] = 0. # when the backend disconnect it it should not be set to 0. self._prev_gen_p[:] = self._gen_activeprod_t + # update the previous state + self._previous_conn_state.update_from_backend(self.backend) + # finally, build the observation (it's a different one at each step, we cannot reuse the same one) # THIS SHOULD BE DONE AFTER EVERYTHING IS INITIALIZED ! self.current_obs = self.get_obs(_do_copy=False) - # update the previous state - self._previous_conn_state.update_from_backend(self.backend) - self._time_extract_obs += time.perf_counter() - beg_res return None @@ -3629,7 +3632,6 @@ def step(self, action: BaseAction) -> Tuple[BaseObservation, # I did something after calling "env.seed()" which is # somehow "env.step()" or "env.reset()" self._has_just_been_seeded = False - cls = type(self) has_error = True is_done = False @@ -3701,6 +3703,11 @@ def step(self, action: BaseAction) -> Tuple[BaseObservation, ) action, init_disp, action_storage_power = self._aux_step_reset_action() is_ambiguous = True + reco_valid = action.check_reconnection_valid(self._line_status, self._previous_conn_state._topo_vect) + if reco_valid is not None: + action, init_disp, action_storage_power = self._aux_step_reset_action() + is_illegal = True + except_.append(reco_valid) # speed optimization: during all the "env.step" the "topological impact" # of an action is called multiple times, I cache the results @@ -3741,7 +3748,7 @@ def step(self, action: BaseAction) -> Tuple[BaseObservation, False # because it absorbs all redispatching actions ) new_p = self._get_new_prod_setpoint(action) - new_p_th = 1.0 * new_p + new_p_th = new_p.copy() self._feed_data_for_detachment(new_p_th) # should be called before _axu_apply_detachment # storage unit diff --git a/grid2op/Environment/environment.py b/grid2op/Environment/environment.py index 0fbf3988..21b1c0ac 100644 --- a/grid2op/Environment/environment.py +++ b/grid2op/Environment/environment.py @@ -991,11 +991,16 @@ def reset_grid(self, self.nb_time_step = -1 # to have init obs at step 1 (and to prevent 'setting to proper state' "action" to be illegal) if self._init_obs is not None: - # update the backend + # update the backend from the observation self._backend_action = self.backend.update_from_obs(self._init_obs) - self._backend_action.last_topo_registered.values[:] = self._init_obs._prev_conn._topo_vect + topo_state_to_use = self._init_obs._prev_conn else: self._backend_action = self._backend_action_class() + topo_state_to_use = self._previous_conn_state + + # synch the backend action with the init topology + self._backend_action.last_topo_registered.values[:] = topo_state_to_use._topo_vect + self._backend_action.current_topo.values[:] = topo_state_to_use._topo_vect self._backend_action._needs_active_bus = self._needs_active_bus if self._init_obs is not None: diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/5bus_example.json b/grid2op/data_test/5bus_example_disco_el_in_grid/5bus_example.json new file mode 100644 index 00000000..4c1cbb76 --- /dev/null +++ b/grid2op/data_test/5bus_example_disco_el_in_grid/5bus_example.json @@ -0,0 +1,1339 @@ +{ + "_module": "pandapower.auxiliary", + "_class": "pandapowerNet", + "_object": { + "bus": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"vn_kv\",\"type\",\"zone\",\"in_service\"],\"index\":[0,1,2,3,4],\"data\":[[\"substation_1\",100.0,\"b\",null,true],[\"substation_2\",100.0,\"b\",null,true],[\"substation_3\",100.0,\"b\",null,true],[\"substation_4\",100.0,\"b\",null,true],[\"substation_5\",100.0,\"b\",null,true]]}", + "dtype": { + "name": "object", + "vn_kv": "float64", + "type": "object", + "zone": "object", + "in_service": "bool" + }, + "orient": "split" + }, + "load": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"q_mvar\",\"const_z_percent\",\"const_i_percent\",\"sn_mva\",\"scaling\",\"in_service\",\"type\"],\"index\":[0,1,2],\"data\":[[\"load_0_0\",0,10.0,7.0,0.0,0.0,null,1.0,true,null],[\"load_3_1\",3,10.0,7.0,0.0,0.0,null,1.0,true,null],[\"load_4_2\",4,10.0,7.0,0.0,0.0,null,1.0,true,null]]}", + "dtype": { + "name": "object", + "bus": "uint32", + "p_mw": "float64", + "q_mvar": "float64", + "const_z_percent": "float64", + "const_i_percent": "float64", + "sn_mva": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object" + }, + "orient": "split" + }, + "sgen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"q_mvar\",\"sn_mva\",\"scaling\",\"in_service\",\"type\",\"current_source\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "bus": "int64", + "p_mw": "float64", + "q_mvar": "float64", + "sn_mva": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object", + "current_source": "bool" + }, + "orient": "split" + }, + "storage": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"q_mvar\",\"sn_mva\",\"soc_percent\",\"min_e_mwh\",\"max_e_mwh\",\"scaling\",\"in_service\",\"type\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "bus": "int64", + "p_mw": "float64", + "q_mvar": "float64", + "sn_mva": "float64", + "soc_percent": "float64", + "min_e_mwh": "float64", + "max_e_mwh": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object" + }, + "orient": "split" + }, + "gen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"vm_pu\",\"sn_mva\",\"min_q_mvar\",\"max_q_mvar\",\"scaling\",\"slack\",\"in_service\",\"type\"],\"index\":[0,1],\"data\":[[\"gen_0_0\",0,10.0,1.02,null,null,null,1.0,false,true,null],[\"gen_1_1\",1,20.0,1.02,null,null,null,1.0,true,true,null]]}", + "dtype": { + "name": "object", + "bus": "uint32", + "p_mw": "float64", + "vm_pu": "float64", + "sn_mva": "float64", + "min_q_mvar": "float64", + "max_q_mvar": "float64", + "scaling": "float64", + "slack": "bool", + "in_service": "bool", + "type": "object" + }, + "orient": "split" + }, + "switch": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"bus\",\"element\",\"et\",\"type\",\"closed\",\"name\",\"z_ohm\"],\"index\":[],\"data\":[]}", + "dtype": { + "bus": "int64", + "element": "int64", + "et": "object", + "type": "object", + "closed": "bool", + "name": "object", + "z_ohm": "float64" + }, + "orient": "split" + }, + "shunt": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"bus\",\"name\",\"q_mvar\",\"p_mw\",\"vn_kv\",\"step\",\"max_step\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "bus": "uint32", + "name": "object", + "q_mvar": "float64", + "p_mw": "float64", + "vn_kv": "float64", + "step": "uint32", + "max_step": "uint32", + "in_service": "bool" + }, + "orient": "split" + }, + "ext_grid": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"vm_pu\",\"va_degree\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "bus": "uint32", + "vm_pu": "float64", + "va_degree": "float64", + "in_service": "bool" + }, + "orient": "split" + }, + "line": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"std_type\",\"from_bus\",\"to_bus\",\"length_km\",\"r_ohm_per_km\",\"x_ohm_per_km\",\"c_nf_per_km\",\"g_us_per_km\",\"max_i_ka\",\"df\",\"parallel\",\"type\",\"in_service\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[null,\"NAYY 4x50 SE\",0,1,4.0,0.642,0.083,210.0,0.0,0.6,1.0,1,\"cs\",true],[\"0_2_2\",\"NAYY 4x50 SE\",0,2,4.47,0.642,0.083,210.0,0.0,0.22,1.0,1,\"cs\",true],[\"0_3_3\",\"NAYY 4x50 SE\",0,3,5.65,0.642,0.083,210.0,0.0,0.16,1.0,1,\"cs\",false],[\"0_4_4\",\"NAYY 4x50 SE\",0,4,4.0,0.642,0.083,210.0,0.0,0.16,1.0,1,\"cs\",true],[\"1_2_5\",\"NAYY 4x50 SE\",1,2,2.0,0.642,0.083,210.0,0.0,0.6,1.0,1,\"cs\",true],[\"2_3_6\",\"NAYY 4x50 SE\",2,3,2.0,0.642,0.083,210.0,0.0,0.3,1.0,1,\"cs\",true],[\"2_3_7\",\"NAYY 4x50 SE\",2,3,2.0,0.642,0.083,210.0,0.0,0.3,1.0,1,\"cs\",true],[\"3_4_8\",\"NAYY 4x50 SE\",3,4,4.0,0.642,0.083,210.0,0.0,0.16,1.0,1,\"cs\",true]]}", + "dtype": { + "name": "object", + "std_type": "object", + "from_bus": "uint32", + "to_bus": "uint32", + "length_km": "float64", + "r_ohm_per_km": "float64", + "x_ohm_per_km": "float64", + "c_nf_per_km": "float64", + "g_us_per_km": "float64", + "max_i_ka": "float64", + "df": "float64", + "parallel": "uint32", + "type": "object", + "in_service": "bool" + }, + "orient": "split" + }, + "trafo": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"std_type\",\"hv_bus\",\"lv_bus\",\"sn_mva\",\"vn_hv_kv\",\"vn_lv_kv\",\"vk_percent\",\"vkr_percent\",\"pfe_kw\",\"i0_percent\",\"shift_degree\",\"tap_side\",\"tap_neutral\",\"tap_min\",\"tap_max\",\"tap_step_percent\",\"tap_step_degree\",\"tap_pos\",\"tap_phase_shifter\",\"parallel\",\"df\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "std_type": "object", + "hv_bus": "uint32", + "lv_bus": "uint32", + "sn_mva": "float64", + "vn_hv_kv": "float64", + "vn_lv_kv": "float64", + "vk_percent": "float64", + "vkr_percent": "float64", + "pfe_kw": "float64", + "i0_percent": "float64", + "shift_degree": "float64", + "tap_side": "object", + "tap_neutral": "int32", + "tap_min": "int32", + "tap_max": "int32", + "tap_step_percent": "float64", + "tap_step_degree": "float64", + "tap_pos": "int32", + "tap_phase_shifter": "bool", + "parallel": "uint32", + "df": "float64", + "in_service": "bool" + }, + "orient": "split" + }, + "trafo3w": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"std_type\",\"hv_bus\",\"mv_bus\",\"lv_bus\",\"sn_hv_mva\",\"sn_mv_mva\",\"sn_lv_mva\",\"vn_hv_kv\",\"vn_mv_kv\",\"vn_lv_kv\",\"vk_hv_percent\",\"vk_mv_percent\",\"vk_lv_percent\",\"vkr_hv_percent\",\"vkr_mv_percent\",\"vkr_lv_percent\",\"pfe_kw\",\"i0_percent\",\"shift_mv_degree\",\"shift_lv_degree\",\"tap_side\",\"tap_neutral\",\"tap_min\",\"tap_max\",\"tap_step_percent\",\"tap_step_degree\",\"tap_pos\",\"tap_at_star_point\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "std_type": "object", + "hv_bus": "uint32", + "mv_bus": "uint32", + "lv_bus": "uint32", + "sn_hv_mva": "float64", + "sn_mv_mva": "float64", + "sn_lv_mva": "float64", + "vn_hv_kv": "float64", + "vn_mv_kv": "float64", + "vn_lv_kv": "float64", + "vk_hv_percent": "float64", + "vk_mv_percent": "float64", + "vk_lv_percent": "float64", + "vkr_hv_percent": "float64", + "vkr_mv_percent": "float64", + "vkr_lv_percent": "float64", + "pfe_kw": "float64", + "i0_percent": "float64", + "shift_mv_degree": "float64", + "shift_lv_degree": "float64", + "tap_side": "object", + "tap_neutral": "int32", + "tap_min": "int32", + "tap_max": "int32", + "tap_step_percent": "float64", + "tap_step_degree": "float64", + "tap_pos": "int32", + "tap_at_star_point": "bool", + "in_service": "bool" + }, + "orient": "split" + }, + "impedance": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"from_bus\",\"to_bus\",\"rft_pu\",\"xft_pu\",\"rtf_pu\",\"xtf_pu\",\"sn_mva\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "from_bus": "uint32", + "to_bus": "uint32", + "rft_pu": "float64", + "xft_pu": "float64", + "rtf_pu": "float64", + "xtf_pu": "float64", + "sn_mva": "float64", + "in_service": "bool" + }, + "orient": "split" + }, + "dcline": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"from_bus\",\"to_bus\",\"p_mw\",\"loss_percent\",\"loss_mw\",\"vm_from_pu\",\"vm_to_pu\",\"max_p_mw\",\"min_q_from_mvar\",\"min_q_to_mvar\",\"max_q_from_mvar\",\"max_q_to_mvar\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "from_bus": "uint32", + "to_bus": "uint32", + "p_mw": "float64", + "loss_percent": "float64", + "loss_mw": "float64", + "vm_from_pu": "float64", + "vm_to_pu": "float64", + "max_p_mw": "float64", + "min_q_from_mvar": "float64", + "min_q_to_mvar": "float64", + "max_q_from_mvar": "float64", + "max_q_to_mvar": "float64", + "in_service": "bool" + }, + "orient": "split" + }, + "ward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"ps_mw\",\"qs_mvar\",\"qz_mvar\",\"pz_mw\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "bus": "uint32", + "ps_mw": "float64", + "qs_mvar": "float64", + "qz_mvar": "float64", + "pz_mw": "float64", + "in_service": "bool" + }, + "orient": "split" + }, + "xward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"ps_mw\",\"qs_mvar\",\"qz_mvar\",\"pz_mw\",\"r_ohm\",\"x_ohm\",\"vm_pu\",\"in_service\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "bus": "uint32", + "ps_mw": "float64", + "qs_mvar": "float64", + "qz_mvar": "float64", + "pz_mw": "float64", + "r_ohm": "float64", + "x_ohm": "float64", + "vm_pu": "float64", + "in_service": "bool" + }, + "orient": "split" + }, + "measurement": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"measurement_type\",\"element_type\",\"element\",\"value\",\"std_dev\",\"side\"],\"index\":[],\"data\":[]}", + "dtype": { + "name": "object", + "measurement_type": "object", + "element_type": "object", + "element": "uint32", + "value": "float64", + "std_dev": "float64", + "side": "object" + }, + "orient": "split" + }, + "pwl_cost": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"power_type\",\"element\",\"et\",\"points\"],\"index\":[],\"data\":[]}", + "dtype": { + "power_type": "object", + "element": "object", + "et": "object", + "points": "object" + }, + "orient": "split" + }, + "poly_cost": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"element\",\"et\",\"cp0_eur\",\"cp1_eur_per_mw\",\"cp2_eur_per_mw2\",\"cq0_eur\",\"cq1_eur_per_mvar\",\"cq2_eur_per_mvar2\"],\"index\":[],\"data\":[]}", + "dtype": { + "element": "object", + "et": "object", + "cp0_eur": "float64", + "cp1_eur_per_mw": "float64", + "cp2_eur_per_mw2": "float64", + "cq0_eur": "float64", + "cq1_eur_per_mvar": "float64", + "cq2_eur_per_mvar2": "float64" + }, + "orient": "split" + }, + "line_geodata": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"coords\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[[[0,0],[0,4]]],[[[0,0],[2,4]]],[[[0,0],[4,4]]],[[[0,0],[4,0]]],[[[0,4],[2,4]]],[[[2,4],[3,4.2],[4,4]]],[[[2,4],[3,3.8],[4,4]]],[[[4,4],[4,0]]]]}", + "dtype": { + "coords": "object" + }, + "orient": "split" + }, + "bus_geodata": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"x\",\"y\",\"coords\"],\"index\":[0,1,2,3,4],\"data\":[[0.0,0.0,null],[0.0,4.0,null],[2.0,4.0,null],[4.0,4.0,null],[4.0,0.0,null]]}", + "dtype": { + "x": "float64", + "y": "float64", + "coords": "object" + }, + "orient": "split" + }, + "version": "2.1.0", + "converged": true, + "name": "5bus", + "f_hz": 50.0, + "sn_mva": 1, + "std_types": { + "line": { + "NAYY 4x50 SE": { + "c_nf_per_km": 210, + "r_ohm_per_km": 0.642, + "x_ohm_per_km": 0.083, + "max_i_ka": 0.142, + "type": "cs", + "q_mm2": 50, + "alpha": 0.00403 + }, + "NAYY 4x120 SE": { + "c_nf_per_km": 264, + "r_ohm_per_km": 0.225, + "x_ohm_per_km": 0.08, + "max_i_ka": 0.242, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00403 + }, + "NAYY 4x150 SE": { + "c_nf_per_km": 261, + "r_ohm_per_km": 0.208, + "x_ohm_per_km": 0.08, + "max_i_ka": 0.27, + "type": "cs", + "q_mm2": 150, + "alpha": 0.00403 + }, + "NA2XS2Y 1x95 RM/25 12/20 kV": { + "c_nf_per_km": 216, + "r_ohm_per_km": 0.313, + "x_ohm_per_km": 0.132, + "max_i_ka": 0.252, + "type": "cs", + "q_mm2": 95, + "alpha": 0.00403 + }, + "NA2XS2Y 1x185 RM/25 12/20 kV": { + "c_nf_per_km": 273, + "r_ohm_per_km": 0.161, + "x_ohm_per_km": 0.117, + "max_i_ka": 0.362, + "type": "cs", + "q_mm2": 185, + "alpha": 0.00403 + }, + "NA2XS2Y 1x240 RM/25 12/20 kV": { + "c_nf_per_km": 304, + "r_ohm_per_km": 0.122, + "x_ohm_per_km": 0.112, + "max_i_ka": 0.421, + "type": "cs", + "q_mm2": 240, + "alpha": 0.00403 + }, + "NA2XS2Y 1x95 RM/25 6/10 kV": { + "c_nf_per_km": 315, + "r_ohm_per_km": 0.313, + "x_ohm_per_km": 0.123, + "max_i_ka": 0.249, + "type": "cs", + "q_mm2": 95, + "alpha": 0.00403 + }, + "NA2XS2Y 1x185 RM/25 6/10 kV": { + "c_nf_per_km": 406, + "r_ohm_per_km": 0.161, + "x_ohm_per_km": 0.11, + "max_i_ka": 0.358, + "type": "cs", + "q_mm2": 185, + "alpha": 0.00403 + }, + "NA2XS2Y 1x240 RM/25 6/10 kV": { + "c_nf_per_km": 456, + "r_ohm_per_km": 0.122, + "x_ohm_per_km": 0.105, + "max_i_ka": 0.416, + "type": "cs", + "q_mm2": 240, + "alpha": 0.00403 + }, + "NA2XS2Y 1x150 RM/25 12/20 kV": { + "c_nf_per_km": 250, + "r_ohm_per_km": 0.206, + "x_ohm_per_km": 0.116, + "max_i_ka": 0.319, + "type": "cs", + "q_mm2": 150, + "alpha": 0.00403 + }, + "NA2XS2Y 1x120 RM/25 12/20 kV": { + "c_nf_per_km": 230, + "r_ohm_per_km": 0.253, + "x_ohm_per_km": 0.119, + "max_i_ka": 0.283, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00403 + }, + "NA2XS2Y 1x70 RM/25 12/20 kV": { + "c_nf_per_km": 190, + "r_ohm_per_km": 0.443, + "x_ohm_per_km": 0.132, + "max_i_ka": 0.22, + "type": "cs", + "q_mm2": 70, + "alpha": 0.00403 + }, + "NA2XS2Y 1x150 RM/25 6/10 kV": { + "c_nf_per_km": 360, + "r_ohm_per_km": 0.206, + "x_ohm_per_km": 0.11, + "max_i_ka": 0.315, + "type": "cs", + "q_mm2": 150, + "alpha": 0.00403 + }, + "NA2XS2Y 1x120 RM/25 6/10 kV": { + "c_nf_per_km": 340, + "r_ohm_per_km": 0.253, + "x_ohm_per_km": 0.113, + "max_i_ka": 0.28, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00403 + }, + "NA2XS2Y 1x70 RM/25 6/10 kV": { + "c_nf_per_km": 280, + "r_ohm_per_km": 0.443, + "x_ohm_per_km": 0.123, + "max_i_ka": 0.217, + "type": "cs", + "q_mm2": 70, + "alpha": 0.00403 + }, + "N2XS(FL)2Y 1x120 RM/35 64/110 kV": { + "c_nf_per_km": 112, + "r_ohm_per_km": 0.153, + "x_ohm_per_km": 0.166, + "max_i_ka": 0.366, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00393 + }, + "N2XS(FL)2Y 1x185 RM/35 64/110 kV": { + "c_nf_per_km": 125, + "r_ohm_per_km": 0.099, + "x_ohm_per_km": 0.156, + "max_i_ka": 0.457, + "type": "cs", + "q_mm2": 185, + "alpha": 0.00393 + }, + "N2XS(FL)2Y 1x240 RM/35 64/110 kV": { + "c_nf_per_km": 135, + "r_ohm_per_km": 0.075, + "x_ohm_per_km": 0.149, + "max_i_ka": 0.526, + "type": "cs", + "q_mm2": 240, + "alpha": 0.00393 + }, + "N2XS(FL)2Y 1x300 RM/35 64/110 kV": { + "c_nf_per_km": 144, + "r_ohm_per_km": 0.06, + "x_ohm_per_km": 0.144, + "max_i_ka": 0.588, + "type": "cs", + "q_mm2": 300, + "alpha": 0.00393 + }, + "15-AL1/3-ST1A 0.4": { + "c_nf_per_km": 11, + "r_ohm_per_km": 1.8769, + "x_ohm_per_km": 0.35, + "max_i_ka": 0.105, + "type": "ol", + "q_mm2": 16, + "alpha": 0.00403 + }, + "24-AL1/4-ST1A 0.4": { + "c_nf_per_km": 11.25, + "r_ohm_per_km": 1.2012, + "x_ohm_per_km": 0.335, + "max_i_ka": 0.14, + "type": "ol", + "q_mm2": 24, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 0.4": { + "c_nf_per_km": 12.2, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.3, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 0.4": { + "c_nf_per_km": 13.2, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.29, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "34-AL1/6-ST1A 10.0": { + "c_nf_per_km": 9.7, + "r_ohm_per_km": 0.8342, + "x_ohm_per_km": 0.36, + "max_i_ka": 0.17, + "type": "ol", + "q_mm2": 34, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 10.0": { + "c_nf_per_km": 10.1, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.35, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "70-AL1/11-ST1A 10.0": { + "c_nf_per_km": 10.4, + "r_ohm_per_km": 0.4132, + "x_ohm_per_km": 0.339, + "max_i_ka": 0.29, + "type": "ol", + "q_mm2": 70, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 10.0": { + "c_nf_per_km": 10.75, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.33, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "122-AL1/20-ST1A 10.0": { + "c_nf_per_km": 11.1, + "r_ohm_per_km": 0.2376, + "x_ohm_per_km": 0.323, + "max_i_ka": 0.41, + "type": "ol", + "q_mm2": 122, + "alpha": 0.00403 + }, + "149-AL1/24-ST1A 10.0": { + "c_nf_per_km": 11.25, + "r_ohm_per_km": 0.194, + "x_ohm_per_km": 0.315, + "max_i_ka": 0.47, + "type": "ol", + "q_mm2": 149, + "alpha": 0.00403 + }, + "34-AL1/6-ST1A 20.0": { + "c_nf_per_km": 9.15, + "r_ohm_per_km": 0.8342, + "x_ohm_per_km": 0.382, + "max_i_ka": 0.17, + "type": "ol", + "q_mm2": 34, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 20.0": { + "c_nf_per_km": 9.5, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.372, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "70-AL1/11-ST1A 20.0": { + "c_nf_per_km": 9.7, + "r_ohm_per_km": 0.4132, + "x_ohm_per_km": 0.36, + "max_i_ka": 0.29, + "type": "ol", + "q_mm2": 70, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 20.0": { + "c_nf_per_km": 10, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.35, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "122-AL1/20-ST1A 20.0": { + "c_nf_per_km": 10.3, + "r_ohm_per_km": 0.2376, + "x_ohm_per_km": 0.344, + "max_i_ka": 0.41, + "type": "ol", + "q_mm2": 122, + "alpha": 0.00403 + }, + "149-AL1/24-ST1A 20.0": { + "c_nf_per_km": 10.5, + "r_ohm_per_km": 0.194, + "x_ohm_per_km": 0.337, + "max_i_ka": 0.47, + "type": "ol", + "q_mm2": 149, + "alpha": 0.00403 + }, + "184-AL1/30-ST1A 20.0": { + "c_nf_per_km": 10.75, + "r_ohm_per_km": 0.1571, + "x_ohm_per_km": 0.33, + "max_i_ka": 0.535, + "type": "ol", + "q_mm2": 184, + "alpha": 0.00403 + }, + "243-AL1/39-ST1A 20.0": { + "c_nf_per_km": 11, + "r_ohm_per_km": 0.1188, + "x_ohm_per_km": 0.32, + "max_i_ka": 0.645, + "type": "ol", + "q_mm2": 243, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 110.0": { + "c_nf_per_km": 8, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.46, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "70-AL1/11-ST1A 110.0": { + "c_nf_per_km": 8.4, + "r_ohm_per_km": 0.4132, + "x_ohm_per_km": 0.45, + "max_i_ka": 0.29, + "type": "ol", + "q_mm2": 70, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 110.0": { + "c_nf_per_km": 8.65, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.44, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "122-AL1/20-ST1A 110.0": { + "c_nf_per_km": 8.5, + "r_ohm_per_km": 0.2376, + "x_ohm_per_km": 0.43, + "max_i_ka": 0.41, + "type": "ol", + "q_mm2": 122, + "alpha": 0.00403 + }, + "149-AL1/24-ST1A 110.0": { + "c_nf_per_km": 8.75, + "r_ohm_per_km": 0.194, + "x_ohm_per_km": 0.41, + "max_i_ka": 0.47, + "type": "ol", + "q_mm2": 149, + "alpha": 0.00403 + }, + "184-AL1/30-ST1A 110.0": { + "c_nf_per_km": 8.8, + "r_ohm_per_km": 0.1571, + "x_ohm_per_km": 0.4, + "max_i_ka": 0.535, + "type": "ol", + "q_mm2": 184, + "alpha": 0.00403 + }, + "243-AL1/39-ST1A 110.0": { + "c_nf_per_km": 9, + "r_ohm_per_km": 0.1188, + "x_ohm_per_km": 0.39, + "max_i_ka": 0.645, + "type": "ol", + "q_mm2": 243, + "alpha": 0.00403 + }, + "305-AL1/39-ST1A 110.0": { + "c_nf_per_km": 9.2, + "r_ohm_per_km": 0.0949, + "x_ohm_per_km": 0.38, + "max_i_ka": 0.74, + "type": "ol", + "q_mm2": 305, + "alpha": 0.00403 + }, + "490-AL1/64-ST1A 110.0": { + "c_nf_per_km": 9.75, + "r_ohm_per_km": 0.059, + "x_ohm_per_km": 0.37, + "max_i_ka": 0.96, + "type": "ol", + "q_mm2": 490, + "alpha": 0.00403 + }, + "679-AL1/86-ST1A 110.0": { + "c_nf_per_km": 9.95, + "r_ohm_per_km": 0.042, + "x_ohm_per_km": 0.36, + "max_i_ka": 0.115, + "type": "ol", + "q_mm2": 679, + "alpha": 0.00403 + }, + "490-AL1/64-ST1A 220.0": { + "c_nf_per_km": 10, + "r_ohm_per_km": 0.059, + "x_ohm_per_km": 0.285, + "max_i_ka": 0.96, + "type": "ol", + "q_mm2": 490, + "alpha": 0.00403 + }, + "679-AL1/86-ST1A 220.0": { + "c_nf_per_km": 11.7, + "r_ohm_per_km": 0.042, + "x_ohm_per_km": 0.275, + "max_i_ka": 0.115, + "type": "ol", + "q_mm2": 679, + "alpha": 0.00403 + }, + "490-AL1/64-ST1A 380.0": { + "c_nf_per_km": 11, + "r_ohm_per_km": 0.059, + "x_ohm_per_km": 0.253, + "max_i_ka": 0.96, + "type": "ol", + "q_mm2": 490, + "alpha": 0.00403 + }, + "679-AL1/86-ST1A 380.0": { + "c_nf_per_km": 14.6, + "r_ohm_per_km": 0.042, + "x_ohm_per_km": 0.25, + "max_i_ka": 0.115, + "type": "ol", + "q_mm2": 679, + "alpha": 0.00403 + } + }, + "trafo": { + "160 MVA 380/110 kV": { + "i0_percent": 0.06, + "pfe_kw": 60, + "vkr_percent": 0.25, + "sn_mva": 160, + "vn_lv_kv": 110.0, + "vn_hv_kv": 380.0, + "vk_percent": 12.2, + "shift_degree": 0, + "vector_group": "Yy0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "100 MVA 220/110 kV": { + "i0_percent": 0.06, + "pfe_kw": 55, + "vkr_percent": 0.26, + "sn_mva": 100, + "vn_lv_kv": 110.0, + "vn_hv_kv": 220.0, + "vk_percent": 12.0, + "shift_degree": 0, + "vector_group": "Yy0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "63 MVA 110/20 kV": { + "i0_percent": 0.04, + "pfe_kw": 22, + "vkr_percent": 0.32, + "sn_mva": 63, + "vn_lv_kv": 20.0, + "vn_hv_kv": 110.0, + "vk_percent": 18, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "40 MVA 110/20 kV": { + "i0_percent": 0.05, + "pfe_kw": 18, + "vkr_percent": 0.34, + "sn_mva": 40, + "vn_lv_kv": 20.0, + "vn_hv_kv": 110.0, + "vk_percent": 16.2, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "25 MVA 110/20 kV": { + "i0_percent": 0.07, + "pfe_kw": 14, + "vkr_percent": 0.41, + "sn_mva": 25, + "vn_lv_kv": 20.0, + "vn_hv_kv": 110.0, + "vk_percent": 12, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "63 MVA 110/10 kV": { + "sn_mva": 63, + "vn_hv_kv": 110, + "vn_lv_kv": 10, + "vk_percent": 18, + "vkr_percent": 0.32, + "pfe_kw": 22, + "i0_percent": 0.04, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "40 MVA 110/10 kV": { + "sn_mva": 40, + "vn_hv_kv": 110, + "vn_lv_kv": 10, + "vk_percent": 16.2, + "vkr_percent": 0.34, + "pfe_kw": 18, + "i0_percent": 0.05, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "25 MVA 110/10 kV": { + "sn_mva": 25, + "vn_hv_kv": 110, + "vn_lv_kv": 10, + "vk_percent": 12, + "vkr_percent": 0.41, + "pfe_kw": 14, + "i0_percent": 0.07, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "0.25 MVA 20/0.4 kV": { + "sn_mva": 0.25, + "vn_hv_kv": 20, + "vn_lv_kv": 0.4, + "vk_percent": 6, + "vkr_percent": 1.44, + "pfe_kw": 0.8, + "i0_percent": 0.32, + "shift_degree": 150, + "vector_group": "Yzn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.4 MVA 20/0.4 kV": { + "sn_mva": 0.4, + "vn_hv_kv": 20, + "vn_lv_kv": 0.4, + "vk_percent": 6, + "vkr_percent": 1.425, + "pfe_kw": 1.35, + "i0_percent": 0.3375, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.63 MVA 20/0.4 kV": { + "sn_mva": 0.63, + "vn_hv_kv": 20, + "vn_lv_kv": 0.4, + "vk_percent": 6, + "vkr_percent": 1.206, + "pfe_kw": 1.65, + "i0_percent": 0.2619, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.25 MVA 10/0.4 kV": { + "sn_mva": 0.25, + "vn_hv_kv": 10, + "vn_lv_kv": 0.4, + "vk_percent": 4, + "vkr_percent": 1.2, + "pfe_kw": 0.6, + "i0_percent": 0.24, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.4 MVA 10/0.4 kV": { + "sn_mva": 0.4, + "vn_hv_kv": 10, + "vn_lv_kv": 0.4, + "vk_percent": 4, + "vkr_percent": 1.325, + "pfe_kw": 0.95, + "i0_percent": 0.2375, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.63 MVA 10/0.4 kV": { + "sn_mva": 0.63, + "vn_hv_kv": 10, + "vn_lv_kv": 0.4, + "vk_percent": 4, + "vkr_percent": 1.0794, + "pfe_kw": 1.18, + "i0_percent": 0.1873, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + } + }, + "trafo3w": { + "63/25/38 MVA 110/20/10 kV": { + "sn_hv_mva": 63, + "sn_mv_mva": 25, + "sn_lv_mva": 38, + "vn_hv_kv": 110, + "vn_mv_kv": 20, + "vn_lv_kv": 10, + "vk_hv_percent": 10.4, + "vk_mv_percent": 10.4, + "vk_lv_percent": 10.4, + "vkr_hv_percent": 0.28, + "vkr_mv_percent": 0.32, + "vkr_lv_percent": 0.35, + "pfe_kw": 35, + "i0_percent": 0.89, + "shift_mv_degree": 0, + "shift_lv_degree": 0, + "vector_group": "YN0yn0yn0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -10, + "tap_max": 10, + "tap_step_percent": 1.2 + }, + "63/25/38 MVA 110/10/10 kV": { + "sn_hv_mva": 63, + "sn_mv_mva": 25, + "sn_lv_mva": 38, + "vn_hv_kv": 110, + "vn_mv_kv": 10, + "vn_lv_kv": 10, + "vk_hv_percent": 10.4, + "vk_mv_percent": 10.4, + "vk_lv_percent": 10.4, + "vkr_hv_percent": 0.28, + "vkr_mv_percent": 0.32, + "vkr_lv_percent": 0.35, + "pfe_kw": 35, + "i0_percent": 0.89, + "shift_mv_degree": 0, + "shift_lv_degree": 0, + "vector_group": "YN0yn0yn0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -10, + "tap_max": 10, + "tap_step_percent": 1.2 + } + } + }, + "res_bus": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"vm_pu\",\"va_degree\",\"p_mw\",\"q_mvar\"],\"index\":[0,1,2,3,4],\"data\":[[1.02,-0.845445168673926,0.0,-111.791243672370911],[1.02,0.0,-21.729831330858325,116.839935541152954],[1.019214100496144,-0.409103297622625,0.0,0.0],[1.018637116919488,-0.503470352662766,10.0,7.0],[1.017983079721402,-0.653497665026562,10.0,7.0]]}", + "dtype": { + "vm_pu": "float64", + "va_degree": "float64", + "p_mw": "float64", + "q_mvar": "float64" + }, + "orient": "split" + }, + "res_line": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"ql_mvar\",\"i_from_ka\",\"i_to_ka\",\"i_ka\",\"vm_from_pu\",\"va_from_degree\",\"vm_to_pu\",\"va_to_degree\",\"loading_percent\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[-7.167647147657727,57.480079867900443,8.03525639977348,-60.113463233922118,0.867609252115754,-2.633383366021676,0.327874112511858,0.343286326507116,0.343286326507116,1.02,-0.845445168673926,1.02,0.0,57.214387751185988],[-0.657313913963437,25.969126903729045,0.866078469150186,-29.007927174007612,0.208764555186749,-3.038800270278568,0.147040043868819,0.164393305610081,0.164393305610081,1.02,-0.845445168673926,1.019214100496144,-0.409103297622625,74.724229822763931],[1.64566972119938,15.370129751576128,-1.540268914180618,-19.229415550834709,0.105400807018762,-3.859285799258581,0.087496748884432,0.109338903896103,0.109338903896103,1.02,-0.845445168673926,1.018637116919488,-0.503470352662766,68.336814935064211],[6.179291340421495,12.971907266349552,-6.119076735247816,-15.70424981919658,0.060214605173678,-2.732342552847028,0.081330018729726,0.095589209712924,0.095589209712924,1.02,-0.845445168673926,1.017983079721402,-0.653497665026562,59.743256070577175],[13.694574931085771,-56.726472302863066,-13.283848894885464,55.407854241119566,0.410726036200307,-1.3186180617435,0.330312825878128,0.322760996590474,0.330312825878128,1.02,0.0,1.019214100496144,-0.409103297622625,55.052137646354595],[6.208885212872048,-13.199963533555254,-6.184761786109662,11.833197159642042,0.024123426762386,-1.366766373913212,0.082632108556076,0.075677384410291,0.082632108556076,1.019214100496144,-0.409103297622625,1.018637116919488,-0.503470352662766,27.544036185358689],[6.208885212872048,-13.199963533555254,-6.184761786109662,11.833197159642042,0.024123426762386,-1.366766373913212,0.082632108556076,0.075677384410291,0.082632108556076,1.019214100496144,-0.409103297622625,1.018637116919488,-0.503470352662766,27.544036185358689],[3.909792486391969,-11.436978768449999,-3.88092326475316,8.704249819196738,0.028869221638809,-2.732728949253261,0.068506463438984,0.054050881891821,0.068506463438984,1.018637116919488,-0.503470352662766,1.017983079721402,-0.653497665026562,42.816539649365005]]}", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_from_ka": "float64", + "i_to_ka": "float64", + "i_ka": "float64", + "vm_from_pu": "float64", + "va_from_degree": "float64", + "vm_to_pu": "float64", + "va_to_degree": "float64", + "loading_percent": "float64" + }, + "orient": "split" + }, + "res_trafo": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_hv_mw\",\"q_hv_mvar\",\"p_lv_mw\",\"q_lv_mvar\",\"pl_mw\",\"ql_mvar\",\"i_hv_ka\",\"i_lv_ka\",\"vm_hv_pu\",\"va_hv_degree\",\"vm_lv_pu\",\"va_lv_degree\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_hv_mw": "float64", + "q_hv_mvar": "float64", + "p_lv_mw": "float64", + "q_lv_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_hv_ka": "float64", + "i_lv_ka": "float64", + "vm_hv_pu": "float64", + "va_hv_degree": "float64", + "vm_lv_pu": "float64", + "va_lv_degree": "float64", + "loading_percent": "float64" + }, + "orient": "split" + }, + "res_trafo3w": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_hv_mw\",\"q_hv_mvar\",\"p_mv_mw\",\"q_mv_mvar\",\"p_lv_mw\",\"q_lv_mvar\",\"pl_mw\",\"ql_mvar\",\"i_hv_ka\",\"i_mv_ka\",\"i_lv_ka\",\"vm_hv_pu\",\"va_hv_degree\",\"vm_mv_pu\",\"va_mv_degree\",\"vm_lv_pu\",\"va_lv_degree\",\"va_internal_degree\",\"vm_internal_pu\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_hv_mw": "float64", + "q_hv_mvar": "float64", + "p_mv_mw": "float64", + "q_mv_mvar": "float64", + "p_lv_mw": "float64", + "q_lv_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_hv_ka": "float64", + "i_mv_ka": "float64", + "i_lv_ka": "float64", + "vm_hv_pu": "float64", + "va_hv_degree": "float64", + "vm_mv_pu": "float64", + "va_mv_degree": "float64", + "vm_lv_pu": "float64", + "va_lv_degree": "float64", + "va_internal_degree": "float64", + "vm_internal_pu": "float64", + "loading_percent": "float64" + }, + "orient": "split" + }, + "res_impedance": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"ql_mvar\",\"i_from_ka\",\"i_to_ka\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_from_ka": "float64", + "i_to_ka": "float64" + }, + "orient": "split" + }, + "res_ext_grid": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + }, + "orient": "split" + }, + "res_load": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[0,1,2],\"data\":[[10.0,7.0],[10.0,7.0],[10.0,7.0]]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + }, + "orient": "split" + }, + "res_sgen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + }, + "orient": "split" + }, + "res_storage": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + }, + "orient": "split" + }, + "res_shunt": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"vm_pu\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "vm_pu": "float64" + }, + "orient": "split" + }, + "res_gen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"va_degree\",\"vm_pu\"],\"index\":[0,1],\"data\":[[10.0,118.791243672370911,-0.845445168673926,1.02],[21.729831330858325,-116.839935541152954,0.0,1.02]]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "va_degree": "float64", + "vm_pu": "float64" + }, + "orient": "split" + }, + "res_ward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"vm_pu\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "vm_pu": "float64" + }, + "orient": "split" + }, + "res_xward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"vm_pu\",\"va_internal_degree\",\"vm_internal_pu\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "vm_pu": "float64", + "va_internal_degree": "float64", + "vm_internal_pu": "float64" + }, + "orient": "split" + }, + "res_dcline": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"vm_from_pu\",\"va_from_degree\",\"vm_to_pu\",\"va_to_degree\"],\"index\":[],\"data\":[]}", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "vm_from_pu": "float64", + "va_from_degree": "float64", + "vm_to_pu": "float64", + "va_to_degree": "float64" + }, + "orient": "split" + }, + "user_pf_options": {}, + "OPF_converged": false + } +} diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/hazards.csv.bz2 b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/hazards.csv.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..5257b64d87924cf39779885383b1eb28f134ca3a GIT binary patch literal 84 zcmV-a0IUB(T4*^jL0KkKSwFUueE?#8+5i9$00Do9005u>av`A50&0+m$n$DKD%z+X qicp+Y145K1?QN?v%Ndn&q@g?cdA%}7a?qj`{9VZu;X*+E+D-H;Z6nG6 literal 0 HcmV?d00001 diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_p.csv.bz2 b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_p.csv.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..df894b76b6a8bc1b70bb1463c061ab7a664af71d GIT binary patch literal 2599 zcmV+?3fT2RT4*^jL0KkKSvLQAQvfh2+W-I%00DpK005)};1hE}#;G;5)rMj5@&Kg( z3Z+uRy=a!3R*hfzUZ1`migH0M}H9sO!N>dO9o=B8R9-s|8k|k6BRRl0i zN=gBmfE1ESlRyJc^~v=9{iY3nqfV)LR7-p%i%l04p8pA@8O?&*0G*>|w5G`{n*m_4 zF*yWBER|bni~=x1|IxOb$JTCk7y-Nyl;aeP5Ynf+X|fs*KsY1};Prpk(Y@GiNqP85 z+I5ek9|QI4stE`CIMuaAD$j{xkxMgbf&i-s;&~%lV#`T=eVMEIop79L!Z?(pS#i6g zq<{e^w5Nn5=NJ;=T8cto2t%3Iz*Yim0fr>C2u@pMMG_TAxSqROp1daDB#MFvY)OCum^gfNyv zYh^K-c-@41Q@dg{8a|rKhe>Od*iF~=y=4udRty(o$+R0%(WVaYEUROX7 zMj!zqA)^d3e9~264|zwz|H7e=5?~&AWBgR&byuN9ci1sl^u#e`)7LelZFJETZt1b zA#6$Jl8N%x;1Qf1BzBUVcMG|8IDl~z0vw4PSPZu3LKqrFe+Crv9dPeYbPEi5A75Q0 zD09a1PJ)rP{co3hAr=wqQ43skMSU3dIo372!%(|c4KQkVyIR@Z&fR_=kIJvf4^VM- zt5#Mm7&W2GQznKiu*_$>Hkx8;nGB|urKT;LCrVvV;#I)rix`?TYHc>0R!plEqS2F0 zt?DtP!I6r{#cLM8@>i;ylX6y>8jQ5Iry9|zk(AKImN%xuEUQVSiqk2KQR;`4I3KO) zjJ7AOEm;^fVAyTr8d@5blUAb^Sl7bj$Yfw?T4=V3eEOyJE6Vll7|f4lhNcXbizbsW zc-4y)q|stwiw)>&D$`2D(89(Qd_JmuA;rv?W=o8kv^1DBvema%#;Zk>6D6f#hNfrN zYGxT~)n*0tPmz2hld@@;uEtm}WU(<|*0;M1m{?dDMyZt5lW(1xZLu$f@UNme?OP04 zVmlU1CYDPhD<+w}+L>fxvYA$b_IqA5|`=3^8UV$mUwIHCZgISTxhd)X{?# zqSRo-!ws)g@Q#snU0AYMWNRy#HDJY}%F(M@ZyajXk)@Qd#&^jcoO1O(j zGL{s+SH_n^4KLLbv@mhSUOL5Pqhy^LSmBZ#Nx-<{S^r^dS&F-TyzgNzTLz+ik*Sy%%1 zPKy&UQ`xm)>^d5C#3WTfB={ByB8+Ap6MH%-_sqM1_fraya2HE1ZMHCwtxR$R?MN(Z z5DPx2$HA<#QiBpo#}Wi5zR#y%08YZz+fJJ;Ef_&fu8Rav93#;Q@sid#2#_L679)zt zv@Tfy_jvX8C6Tp*Y$)R)&z4aJ7JO-ib`-2p+hJ|m%@oDh+7YjZoddlQ3?-^r?bN9+ zGS&mVU_x12^PyoCkt`@45Wu*Sn|Ka!dnu_d##~pFGdwVa z3iw$|+YN7+>jaEoX=iQh07f3hs6@w_vZWYQJsE1@6i~Eij3I+5m+RfkiUBx}%V8LZ zk>Wn3;1RgP4AreAV;=>uxSVNlR3I$k;Ve*6Gp!q~zKBRh2AHXkVA!J{J`>g}44TA_ zj$F2WG)BW(ELmh0Y%*HFeNxjJm|#lMRbdA=fSb^ZfV|v`)hNfrstX%f*&6|-FioYf zC1Qvtgei=cwW&W>_jo{Ij017BJy~ihe9UcaIUa1=2fIzBmbs;tOFcw6dWnP^a4v zn*bC##{)Htoquz;d4VtIz1?K0)s=kC*1=O&d}vrcdUtN3cT0tu76*%4Z96q^_<>$a z=fx>Y0z$DhQvu$7w8bpY@`Jujk(a+O; zcHp<-pG-=>!z$^2thNzxN`zPOO9E^*9x>uUX(g4#l&9mn5?I1LiGJK*IFT&uCHaWA z#S#PvKWz!6Uu?Ux>+9_K^Csjj*;+5cJDUNVPS}!kdb4e)WtD{*Hq^t`@v6WN%<5+S zQuy)yb|cN5*6lhThVzu z7@j%Bgv$YCi&sM%H2ZYVx6#nQ-+r*qTj*HUL}$r!j)7v%l&yfINK|^3FjQkdSzV!( z;&wU@G?o84?fl+mB(Rp8<9L}0cI@bTl-un7%+I%bQ6LH{tlDP4n+ZxA_tD<={J2=n z`)!H}tX6q4lWkW~qzL{Hr7nExO|qk^Y;sHKu_?*MKgE>K#PKSJnvWYH(Y zr9Bv{mSgvN?(HGtAC!7hegb?Q>Eb86-R8m+hylb&QH~!56@&WmWTPVWO*;3$LDJ4Y zS&4m{V&GOFF;0M%6-LWf;zwN@8zAc_N%P8_deGft;@reF#I(c*K8)F?oZVAP82zzo z7d958wx?|@{ZKng_QctUW`sWGJ*7%g6FMF&SF1A+$T($Xveg;AAy%SKk6=moyOJrw Jgn_sF(wGWx#)<#{ literal 0 HcmV?d00001 diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_p_forecasted.csv.bz2 b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/load_p_forecasted.csv.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..d91236226918e0815e81240016e95d5edfffe5b9 GIT binary patch literal 1073 zcmV-11kU?HT4*^jL0KkKS^gyaa{w?gTL1tM00DpK005)};0hcMpa2j)Kmafb02BpW zMxlggX^^Iw7?_xaG|0rn#1eX?NkRXrhM>Y~qMxb(paPOgsp%i6Y6sPS4VxtrZBa>* z#r)W0)=?={8Y*Aa!C1S)kYCO-3)k z#VkZ$oU>3KX);?X5qqj;wT4S;Oqa%Gh8le8Ef-AdnPrr`F^i#NshU$>L2iLpX|gXQ z(N)Y4ldFq+t&MI{StWMpie_GH8ltO|86aiBrF)>!jcbyWvvH*_0*iFSE!EX?q3fjE zqGrxUl*`iPLvF4sn&`aSk&QQ3Z50)}E{#QruWP8J)x%wA%JtG|G}1RS3hhywd!ta4 zLpCIEqcwQ>?Da7Sh8lkB?p_H#9(j2OBT_ojdR)fl{6V$v( z%2z7n9GERtttBqfjiN}{MK-A={8Fm~j4v%h)ief^Bs7^t zq|~Ms3ejY%QfjEeF;SwlS4Be*Y+6l55xYNjN$Qz%*{kmW>a zM@nfUNNP!_w5nwcRWhSgEL6mdQozX<5T74eVEe6pwWY`2rnatq?88;p+A|SX*7&OG z`xZstRTlWDzE|j$6h`^A(Ka%5eX&HzzFOTgCdN|TZRkr$lU;3aK?swxrq~2Eg0ITZQ=>ClT;Wg*Ukn}t&=Ksd}B0PTN_!4cWI4@X^Cpx ruPL(a5*jrI)@azR(X3WS}?MakkYqkl?Y)!y&9%xnx06JRSj(z*+Wz+sPoFA zg7p4(m2|VxVs)foiD*Q5d$TC>5~`wpNgi{`LLzb}G)SWI3e0Dek}8Jf1#tye1^Z5L z;-cc_i3qvGBHKKuiY|$NQZH&bNhDH=93JVeCmDEMPA0q(5kiZ0;&Alxv-210%Gv1A z{N7|`1ruvm5#tLvofk;3e&4a+IBy-w=e3s_yCd4Bc@aW+P`HJYYmG-pc|}hqrn%V6 ztZZxvJ-zeC!$m=4ysmh|URwsFQAI>vMIKaIsJV(sBhnndK&T&q& z$^)W7<*b-Kb0d<4Sfs*8J7t@3l{T}6#xzQET~Ah(1XSHTJruoSv29tdrtjSwc--mo z#NbmvuCl{ah_%y-5@#eWW*j1DC88Ot$ zo<}6TCRDQa-3rtxo?)z0mG3*dy5Q~-t6`Fth+%3ilDS36Rt1e=CmN$slLG2TA~cIw zvX$0Jg_9E2Mb#^iWlGc?Eel17lx9v+bfxGx6ST=M7%ehPn3%)C;;C>BM+rK^MJ}r9 z7ZB+#saINLZ78^$2T@%svqZa9VU`5yT&U`!a+alBz|g}Hn3pPaQo;D|tHHe(*im%m- zo~GujP(G!L3re1O?80Z!Bb5Ovq=aGWPkC4GC)Ce8@qsHdnWv<*Za%$~zHt4N6h%=)`zT35u(G_2i$#hf z=Unj<*4rT*XAoSX1oe>=SqVr)=udm+utQQu)P+~7PD(#+=>@B@D!%%m=p=)6_eK}1 zp&l3MqYCksu4JEWu5zm_@4PCgk24AOlu;ED8EBB6T-qd}5qUp)d+3Dn^rKfZ-nmf` zRe5IQ78ns^Qi=A-nP}Bd&QEEo73fjx+L9D=XeWt*QCIf6DK~hT4MO#{<6ZOP=<@w? zXq8u?>(rFdXq{SMl@SFbs8v6g>$%XRSYb-%=5| zhPtEK`K?^Fb2g@mQL?+&!a`_=5phgJCUM5H_8eL7o(Qb_rn(@iKB*F-lQW&UcKG<0 znZmu;^?eZ%Vx#q(stSok&LzzoV2PwD`5WH(52&IzqmHmB%3R#yZzyFP6vZmX8H7@@ zUV4H)kSMb%xZ0KeUy1C?Qpo*@TXg$_~RAwBywq?_{ z#66czfuv=wC4IRMmF*IzFC#235=_j4nN_8Rq-83lDo2P#@65sERHm``MpLC#0EyN|_-~$0S$elySvX!0jrX zm%56IvZ(Nv^1Sde?>AYA9k;&v`u2MZ*&!sPmPs3>2i!)>vxvyD>p0f_J})>;267g_ zrb0v!R=#zvTnJG<-4zC%j(j3{N1WYQ5uKw@Sz;E3%dFd?j*c3*dCz∋VQUW#<KY0%#-w%Dra`GJ9NLd-7L{<0Qs`5N-(MA&|j!aJ_MN+8B z#mfq-T8*e)DdOk7C{ml(RCIA#9o{5|5oRBr>0I3r(pX(olI6O>BTSRC=TD6LZ1=Vm zP|L1{u9#P7$wqrB>#DV!OrnW=6;Tl$_n=kez4OeO^HkQ^3hO1ps*A2}$hei26=tH3 zPai0|uDaK&=Nm&ou2faoEZMdDv};_~Q8L3{ z$5a|Mw=7&UDQptUURKvDr6goX+Eo(D^KH5(8KjvSoAg_yEb`UYa|Uh8cCn_OYpb_J z32dmTEQ)IN4H(2$HKwr`l-|OFMKUdPHFdT#WwEXHYa=QthTNlW)|EB0ExgGl$zw$b zn`@Tcs8qFyG#cKZ6%tjH%TfV?tJI1zTFIMODonD~=#>_!3pT8#B9m8|*%?!6H5iKx zn@M}+u$qmVOV5EGAv)>@M6Uv_k#GzpijGL-E2vhAVx`EAA<9;O$y21AMCz%OEL3QW zgV?L8sl<*Bs+^(0(pAYvN_2+>I!7ouNZhL`xQ?O0PDybbg@rUJ#9uNi>iX!R>d8rL zrENf~X$!(CycR`u3V6j1sa_F@Od3+Os|aK=DX1|@)GaESgA_GYlo%#KWGzW@g)}D- zX#+%PiqtX_C0c~ZEI`VpP%$e(84-li7f6#;6{HE~^qOps zRY(b1?O#?YBO1oTZQAjzl2a9~+kH`qD#{XBYjxl;8*E}3t9Gxls3{qu*;yFM4Q<|R zr2=KO8zmDpqPJ~*(_=(QrKSl=YTf8rG-i_48A+-ucKej1Y{F(*uJq9~l9tUaCM|XM zNK{2L8r9nLr7Rhw)M$%c_L+=YF}60>=(QI7-jvK{T3ITh45qi_9@etbvdqUz%GI`G z6}14RSLLl=6jNqXW};Iav`A50&0+m$n$DKD%z+X qicp+Y145K1?QN?v%Ndn&q@g?cdA%}7a?qj`{9VZu;X*+E+D-H;Z6nG6 literal 0 HcmV?d00001 diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_forecasted.csv.bz2 b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_forecasted.csv.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..5257b64d87924cf39779885383b1eb28f134ca3a GIT binary patch literal 84 zcmV-a0IUB(T4*^jL0KkKSwFUueE?#8+5i9$00Do9005u>av`A50&0+m$n$DKD%z+X qicp+Y145K1?QN?v%Ndn&q@g?cdA%}7a?qj`{9VZu;X*+E+D-H;Z6nG6 literal 0 HcmV?d00001 diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_meta.json b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_meta.json new file mode 100644 index 00000000..e6faa8ec --- /dev/null +++ b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/maintenance_meta.json @@ -0,0 +1,7 @@ +{ + "maintenance_starting_hour": 9 , + "maintenance_ending_hour": 17, + "line_to_maintenance": ["0_1_0", "2_3_5"], + "daily_proba_per_month_maintenance": [0.0, 0.0, 0.0, 0.02, 0.02, 0.03, 0.05, 0.06, 0.03, 0.02, 0.0, 0.0], + "max_daily_number_per_month_maintenance": [0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 0, 0] +} diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_p.csv.bz2 b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_p.csv.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..45ae98a8e29e7001d8c2f7e8e9160f77b69fe6ab GIT binary patch literal 3326 zcmV7NlBfV`Z7~X_rkE0%WK+_p07;}&*s6d6 zlBwxNfuqz4Q&Op*&< z=BFo6k8^BqPBM2rGTkY~Obvxq+Dz|Ws4KCW&XqAmT*5pH;P~*IePRoJ9?BLE46Yj9 z>Ct_njbfGMbCYiC0^ZGNSxgzZrn3?4PUZ5$q64?Y_6ypWg_0uZ<`9tCjS#kBQ1M zrSzHD_Da6WOC(#EY!c%Mc2#A=d1Hob?q>|k<%&9wEMyz3)Y?PTo>LOa3&XUAumw;R&<=W#Q{f|nAD-)3gM z6N>H}w{-Bn7_rr8hPsC+K^537qmDA3zP`%NJ;d)s1J&Gd+?zDoohS?!Lvu5sG2H6R zq_uJti7jk*ZNA>sM$H})C)ZFe!^RSDiCxDmp`#!Q?XzIS&lqJJ2Dt@c zJA4mfaqC=oBsUc9PjWkBT|&8BsyAnPa-8b=shr5CX6myPH_%*>ZJaXpc4>EP(2R<^ z#TJdiBBxTSaprwR-+NZX7}a&u!WxJzRnCH*%~?65(AjPX=(XC-vCQzPBYTnBtHq|o z<$KsdJ#;NsDQV3Wm$yxjsYx-q8MHAn;LQMluL**cA25WKt4rGvhILo6*>V?Tud@c}k1)w0 zCiVSHC70N4=4XFy<@Y(m4u*)IqA`q6c+D1McHGApV93#{Y*c$_CS{1Z?9()+R)t8U zR!uwzswdp^?+u2j=y$2$%$9KH$LCDul-mZgBTca(&t-T>J~<06(w=S@Y2!~3x%Y+m zj1wSuErd^+9e%s^-P&j>sNg3p=4O0C!zQ!cmv{12c}J?Tz_dhE6ST6Rm3}O>4rblm zORX)Lm@!XhJqJu5IZl{hD)o;G8-^4NqfRiRmv3t?;OJkx ztlhfGNhBd#4$b;7;PlX-y*4R_R7A00Br&l4vOySZF|#5aS&s=*SZ&$!pGMlTO;jO1 z5~1IyjkOa?O=?j_rCZFwa}(KOqUb2GW~&6$Ue7556lJt66czVZhLP|@s#ek5z8ia& zW}6V(!zIgqKG~;V54rU1w$EX?c|J5}Df=gkp1sZD%wAn8cA8(%y^v#dV(PZ!P~#<= zui_FDFAqCG6q~dqE5Rx=GGgj?bg;I;8Ei49RyMhfD{Y#R!!>6_RYX4xSq})Z0fGX- zR9M9jP^?5G@`7}p$(38x8}o(xP(smX)vU*OJcBw!v=~H(qhQuKRaGp}Y7DjQqlc(P zRzVPu`MMqwjogxM!{Odo&xKrz<>}+(EO#NQDk-hnTJ@0-aV)}|%4=~<+%-_eVaTww zuvr!bw2-V=eiE|VEGt=~BB;J9B8vr3L}DqFKv~X*q2mKH={pm!`}UrAXFnKVj3})| zwEE$bOs)NU%9+y>P1rql-Ot^$u~4U)9>b%VVqFR(DG0j_i&!U+NlD`b5_$XC^t{Tf zN8eLO@vxO3kO>Onx@ebiVa6z<^@iy|W}?)#$to3-tYQd?qauFHP+B%5wu5Y~7KrO{ z5d>nG)$-wL)wYXEWu+L}ix~zWi_q$xo-oOVpLD!_`z!0grDffSS63>*%I#wYJg!Oe zi6e&IBQ##%>((~fPcJ3Y&NVP`3iFg76XmzIC3=OrK{tL+#z5rP@@_`&Kql(sDdE~umh_dxtLbYbJqBw;MO7WunPRnJ z^D>oU2^hj?>MScLw5WS3>lt9awu=o+%TPpAOh82y3B%L29zKsN@5k&6_WgywiqV!N zJ{96|S$D%cc&AFq9a`>tJ)u<+X>SYyEFmu+6Jp39#JrGUtlXY~P=t*igPDZNS>FEg zGvQS3s?A{KmsF*f$(QQkm@Le*DR>G^RSMLpnVD`PFvL))Q1zygq{Mp`MIwtH z2Yn76Q+8~7^XR`E9(=K)Bl*>I+h^@}h9129VYljdD$DnrUtT)A%1Z8^rbf*3a!jGo zhGdl=i?ids4*hIZ@31Bx=x0Z8m6sNO3`YJR;i@aWiYyqmD1q)QBrvV^qxkeNtDr%sLECTCiK(?r8r5idA!%iMD|4f2w;Zfu%F|YNOKLGR!HJfZt2Jn}(UkBh zqg3T}PNzl5!ILXimRe03wUZ5ADnVQq&&>+&wTtMFqb!Btne37ux;bnel)Woqm_a;f zf;I5LAaC4!@$*O7me&g;bRd}^iAQl2!gq`CcpTl{4B>+ooxoUREX=hw?diJQYOx^6 zIDvF%_3Lo&TGPZuDzh8)R~)P0?TaGH`w9t>;?DP{F1e30S2 zqLl+Sg3aGXIa%)Os1$=oVDCtK)36mL=+i;%QM-q*RcytK=DhI4i7O4!62%j`(n-Q^tU3)xs_F?-o5EjQeO#(im1 z6o~{S<%-alE^TjZ6zz#a9T$@znj+wPxP z_8V^!TMA8US-GdUR@wDy2$#2Ia>!;$S;t=^er8u}_7g&7oUGGaH)(iX+0bJV(;=1b zCnJP#lej_G?;%fy?Wx^seW~y<+ZcunyJJ~H-R&C~V2NRdEN-AtaF!-&EFq_IdrQz< z?j5&6x_QgKnUYZ_L;-;TZE0i>+svj3UCDQPG`*GAe*VTtFxP2EZqjTEVRfx23$)8|E} zsOKF<+3JvK8t@qlF6o;VNQAXwhP+|N*FGMuSnZmv}bp3xLw`q+oTOti6`m| zJPlML(QT+*X)McKjw{P%5xt&UMquRJDP$lv2q2Nzme7+JyPI;U2kQhP4Z*%_#fI71 z*_!m4W!0<}VOAM*MjsnqI}AR);D=@+6>xQs8HX99ye@bUVCQfUC!q3JItye#d?Ud9 zdNqYB04=wuT%Jm7q>Z^=-#$LX0@lD4qd1!NdfT{jcLxi=4ZIvQM;SHgrZxVo(_ZUQkBYg2pk2#+oy)vaI+%bbU|fLw8nP)-c9erZU-iclEn^{q6oP0F0r#VGvELKJG{PSuzb`U%2M@$S4EH#;OB(9nsFPgsX-tl4Dlfmk#;dPHn1iIfPe^+Hu1i51+w9QBJ-~L^(;z6mg8~`^AE-eqzN`noqdbh zgkN^8^F`2eHLkm$;MgF3_UiIjWKcBXc6U24ZuH^r4`zbiHv6QKNe6m(q>}FRK{H{D z+|Jw0=ofx|DLQZ{qK{u~tXMr}Yg80{2(En@@$shfd}-UdYBzmVMYHc#ZJY(W1?2Xj z9o8%qRoEE2C@P5A%dk#+mEA%h^#wo{I5(?NCNRMA7_b)L>y&L(T=rnhBxK$!w^g%7 zoL(J+FmuGaQbla!CE6%HNJ*rLk_^nD)|LghqUf{^Z_@#s_E92Cv2i4jL)p(^N5 zOUg+*vTltGJ=MEIYN#E8KQP}g-i>kuq5*i5gi$r18=@&)oyQn_u!TB-6s_hp!+pz6 zlZG${T`f;6<2lz%E3hC09^#@NfX?y*#-q8~Xnx!51x>S@n0p1k7s6k8E>!c`;eK-o zW$2T0pv;`QINv`%4cir2YYQSmeP$+0w_KJ_Z*JCWJ0iS+aH5J-GPGZsT$k?obM z#)x$UHZt&fp9mR*h6oZ#=)&ARNUj84BSQ3N2~9NDmiMzv<4*{)+d1pW7fs%(@t!x_ zG!yGyroxncSyc_weH^NiH^GkXUQA%YhjTEXGjq!vkqLGj?idtnF9?sS=Hg{ELPR5O*grwP^kOg7-okdDmQT|(?wC+y9!x#Bv-M+F7HgXR%9}eRt<48t}J@;;1^VC3&iZ5s*Tt;SMAr zIg11&C)QHj7&*dp#u$_}*kqzp*<*u&knORX6f`y9b`Zd1q5(df@4=E`Nca|Q6jj}+ z@aeIQCN(d;o+R2#%X;b1n9~}fhkUu=zhB!Vb(zLw^*=M`mwM|+&DNS!wPfUvarNp zgtCl(R)od0>tOo1s`koS?7OyjmRk^piDalNpx{O(S{0RZ*qFK`)KHkt#vu`eu>v9! z!4VK*8pEMth>T)m5XC^TZ*fSXkApOkPrmr0sPcYnaAPB?Gkx{v2JBn6~n{6e?O+WnQH67(sG8s8VkWw+Q8$P%!8J4tQnTJrdP(R z-N<0qui~~KD$zY(9V#hGtaZ_wHmt1oEG@I*+ibRlcF}7n#UY3aA||4$D0LE6EG?q$ zWX#HntQOEwqQw)X5|))3S!qTHh^VoEz&LZHKKsU2Wgk)IUw3qpVn$OfAXJOC%5*-6 zH?!>Y`-`1*9fuztrKj1X_>~MFEN&TQQJN$mhUt;R1@fL(c4T_ z88l`M_cD~R&y+AkMhapIMOf)XY!2m9WrEHzlAX&i-1)3lclk2GfH+P!CoTO2tS7D+3lnvs%yqRKIRQk^VLeHCQ; z3RIXF`%Jd13=`rk(%Pj#W~Iw&v2jKi#i+0*v&c~3Ol)W{-VP~I^2kVS-E|v?%eQwz zw2PwNvIOt7UD4h3RFMsKG3M8|PiL#?mR{<(-t$rX}_I(eRE?COkKRxh$v=e|OY zu)Dg@upO17Xd3F;Dos!^RZ&9_vL&Bls9>3AQeerl7(9g)g#82|e-q+;{ph%(sN`1; zqH%Joql9%iCsUN=bss4Y$3pI)dan*nT&FIsT}MNu(ztP59JxBWT)sg^sVB}-UnKas zU0nw*7ZuWR98OD;;dLD+BZ}yCUlOT3N~ekHI;Rtn$jTS#ce zm0_lpc~q|#k0iq|rlvA6YBgn9Mod{uw6S5SsjCedG_^5$BE24uO;(I()YB6d8BCia zCeYEbS#HSU%?(z10`*>3v^2Gg7HDc_EG=lt#w{kAnM|6RPM1mKDXP>tTu!U0aOrg9 z>!Yiw)pa^toN#Ir>)%Y@JpKLtd-4ANdrZ~FH@doM7e7j!?<<2oF(=X{?z{{*IPrfK z)b;U0tzm}k9lkWuc9Xol+VjHZ$k=VL_Yx<^1KS&R^1&G}Z%j?@yhBFhe%_gZx3PFM zZDLP(?Z}rW-G@;zD2}?YaDQ&w-KC=4Hv{zEs$3_SoW>zI-#O^_PM?JkaMkc~} zJ?*APd!6&=?<=x<-NAKc0EV1;6?w0_>Uo?--jTKBd{@)khCwBpnHs~^YZhVb zXVb_*1+y$QdVdh`G;5vJ3 zOQ=0^rU#&~>ve$fnVBUjLDToV{h(O{Z5bgs7+aG>2uF;21eInFEx)&CS=@cA+M~zy zo~o%Ef}yk{Ag)J2A+3FS%EnEB;zHgkcZ9*yU^;>Dbb�YLhgZXuB@Kp%x6=LPYcl zQC6dq9J*;46uB~HQ+U!&8FP1bE|-F28pFWJUDB7l!G?C$T{W1k8p=Fz`e-4%a(KlF zuD9#asYkO66`v3gn5Do%Rp5b^s_P5P60ZslQWOxZWK8lE!7cp*cXmv}N*z;r%kW-Ar8vC46MV( lUKnAOQsklu38eY`PcCNfB%R0UC9*TLO>U~ZHQi?+w}kd literal 0 HcmV?d00001 diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_v.csv.bz2 b/grid2op/data_test/5bus_example_disco_el_in_grid/chronics/0/prod_v.csv.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..9fde13d8afbe1db215c8c51ccead2bcb59bc25b0 GIT binary patch literal 78 zcmV-U0I~luTcBmuHbT0jyk9CrW! literal 0 HcmV?d00001 diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/config.py b/grid2op/data_test/5bus_example_disco_el_in_grid/config.py new file mode 100644 index 00000000..1ec901a0 --- /dev/null +++ b/grid2op/data_test/5bus_example_disco_el_in_grid/config.py @@ -0,0 +1,19 @@ +from grid2op.Action import TopologyAction +from grid2op.Reward import L2RPNReward +from grid2op.Rules import DefaultRules +from grid2op.Chronics import Multifolder +from grid2op.Chronics import GridStateFromFileWithForecasts +from grid2op.Backend import PandaPowerBackend + +config = { + "backend": PandaPowerBackend, + "action_class": TopologyAction, + "observation_class": None, + "reward_class": L2RPNReward, + "gamerules_class": DefaultRules, + "chronics_class": Multifolder, + "grid_value_class": GridStateFromFileWithForecasts, + "volagecontroler_class": None, + "thermal_limits": None, + "names_chronics_to_grid": None, +} diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/grid.json b/grid2op/data_test/5bus_example_disco_el_in_grid/grid.json new file mode 100644 index 00000000..b8360012 --- /dev/null +++ b/grid2op/data_test/5bus_example_disco_el_in_grid/grid.json @@ -0,0 +1,1772 @@ +{ + "_module": "pandapower.auxiliary", + "_class": "pandapowerNet", + "_object": { + "bus": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"vn_kv\",\"type\",\"zone\",\"in_service\"],\"index\":[0,1,2,3,4],\"data\":[[\"substation_1\",100.0,\"b\",null,true],[\"substation_2\",100.0,\"b\",null,true],[\"substation_3\",100.0,\"b\",null,true],[\"substation_4\",100.0,\"b\",null,true],[\"substation_5\",100.0,\"b\",null,true]]}", + "orient": "split", + "dtype": { + "name": "object", + "vn_kv": "float64", + "type": "object", + "zone": "object", + "in_service": "bool" + } + }, + "load": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"q_mvar\",\"const_z_percent\",\"const_i_percent\",\"sn_mva\",\"scaling\",\"in_service\",\"type\"],\"index\":[0,1,2],\"data\":[[\"load_0_0\",0,10.0,7.0,0.0,0.0,null,1.0,true,null],[\"load_3_1\",3,10.0,7.0,0.0,0.0,null,1.0,true,null],[\"load_4_2\",4,10.0,7.0,0.0,0.0,null,1.0,true,null]]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "uint32", + "p_mw": "float64", + "q_mvar": "float64", + "const_z_percent": "float64", + "const_i_percent": "float64", + "sn_mva": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object" + } + }, + "sgen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"q_mvar\",\"sn_mva\",\"scaling\",\"in_service\",\"type\",\"current_source\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "int64", + "p_mw": "float64", + "q_mvar": "float64", + "sn_mva": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object", + "current_source": "bool" + } + }, + "motor": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"pn_mech_mw\",\"loading_percent\",\"cos_phi\",\"cos_phi_n\",\"efficiency_percent\",\"efficiency_n_percent\",\"lrc_pu\",\"vn_kv\",\"scaling\",\"in_service\",\"rx\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "int64", + "pn_mech_mw": "float64", + "loading_percent": "float64", + "cos_phi": "float64", + "cos_phi_n": "float64", + "efficiency_percent": "float64", + "efficiency_n_percent": "float64", + "lrc_pu": "float64", + "vn_kv": "float64", + "scaling": "float64", + "in_service": "bool", + "rx": "float64" + } + }, + "asymmetric_load": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_a_mw\",\"q_a_mvar\",\"p_b_mw\",\"q_b_mvar\",\"p_c_mw\",\"q_c_mvar\",\"sn_mva\",\"scaling\",\"in_service\",\"type\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "uint32", + "p_a_mw": "float64", + "q_a_mvar": "float64", + "p_b_mw": "float64", + "q_b_mvar": "float64", + "p_c_mw": "float64", + "q_c_mvar": "float64", + "sn_mva": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object" + } + }, + "asymmetric_sgen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_a_mw\",\"q_a_mvar\",\"p_b_mw\",\"q_b_mvar\",\"p_c_mw\",\"q_c_mvar\",\"sn_mva\",\"scaling\",\"in_service\",\"type\",\"current_source\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "int64", + "p_a_mw": "float64", + "q_a_mvar": "float64", + "p_b_mw": "float64", + "q_b_mvar": "float64", + "p_c_mw": "float64", + "q_c_mvar": "float64", + "sn_mva": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object", + "current_source": "bool" + } + }, + "storage": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"q_mvar\",\"sn_mva\",\"soc_percent\",\"min_e_mwh\",\"max_e_mwh\",\"scaling\",\"in_service\",\"type\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "int64", + "p_mw": "float64", + "q_mvar": "float64", + "sn_mva": "float64", + "soc_percent": "float64", + "min_e_mwh": "float64", + "max_e_mwh": "float64", + "scaling": "float64", + "in_service": "bool", + "type": "object" + } + }, + "gen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"vm_pu\",\"sn_mva\",\"min_q_mvar\",\"max_q_mvar\",\"scaling\",\"slack\",\"in_service\",\"type\",\"slack_weight\"],\"index\":[0,1],\"data\":[[\"gen_0_0\",0,10.0,1.02,null,null,null,1.0,false,true,null,0.0],[\"gen_1_1\",1,20.0,1.02,null,null,null,1.0,true,true,null,1.0]]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "uint32", + "p_mw": "float64", + "vm_pu": "float64", + "sn_mva": "float64", + "min_q_mvar": "float64", + "max_q_mvar": "float64", + "scaling": "float64", + "slack": "bool", + "in_service": "bool", + "type": "object", + "slack_weight": "float64" + } + }, + "switch": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"bus\",\"element\",\"et\",\"type\",\"closed\",\"name\",\"z_ohm\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "bus": "int64", + "element": "int64", + "et": "object", + "type": "object", + "closed": "bool", + "name": "object", + "z_ohm": "float64" + } + }, + "shunt": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"bus\",\"name\",\"q_mvar\",\"p_mw\",\"vn_kv\",\"step\",\"max_step\",\"in_service\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "bus": "uint32", + "name": "object", + "q_mvar": "float64", + "p_mw": "float64", + "vn_kv": "float64", + "step": "uint32", + "max_step": "uint32", + "in_service": "bool" + } + }, + "ext_grid": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"vm_pu\",\"va_degree\",\"in_service\",\"slack_weight\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "uint32", + "vm_pu": "float64", + "va_degree": "float64", + "in_service": "bool", + "slack_weight": "float64" + } + }, + "line": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"std_type\",\"from_bus\",\"to_bus\",\"length_km\",\"r_ohm_per_km\",\"x_ohm_per_km\",\"c_nf_per_km\",\"g_us_per_km\",\"max_i_ka\",\"df\",\"parallel\",\"type\",\"in_service\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[null,\"NAYY 4x50 SE\",0,1,4.0,0.642,0.083,210.0,0.0,0.6,1.0,1,\"cs\",true],[\"0_2_2\",\"NAYY 4x50 SE\",0,2,4.47,0.642,0.083,210.0,0.0,0.22,1.0,1,\"cs\",true],[\"0_3_3\",\"NAYY 4x50 SE\",0,3,5.65,0.642,0.083,210.0,0.0,0.16,1.0,1,\"cs\",false],[\"0_4_4\",\"NAYY 4x50 SE\",0,4,4.0,0.642,0.083,210.0,0.0,0.16,1.0,1,\"cs\",true],[\"1_2_5\",\"NAYY 4x50 SE\",1,2,2.0,0.642,0.083,210.0,0.0,0.6,1.0,1,\"cs\",true],[\"2_3_6\",\"NAYY 4x50 SE\",2,3,2.0,0.642,0.083,210.0,0.0,0.3,1.0,1,\"cs\",true],[\"2_3_7\",\"NAYY 4x50 SE\",2,3,2.0,0.642,0.083,210.0,0.0,0.3,1.0,1,\"cs\",true],[\"3_4_8\",\"NAYY 4x50 SE\",3,4,4.0,0.642,0.083,210.0,0.0,0.16,1.0,1,\"cs\",true]]}", + "orient": "split", + "dtype": { + "name": "object", + "std_type": "object", + "from_bus": "uint32", + "to_bus": "uint32", + "length_km": "float64", + "r_ohm_per_km": "float64", + "x_ohm_per_km": "float64", + "c_nf_per_km": "float64", + "g_us_per_km": "float64", + "max_i_ka": "float64", + "df": "float64", + "parallel": "uint32", + "type": "object", + "in_service": "bool" + } + }, + "trafo": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"std_type\",\"hv_bus\",\"lv_bus\",\"sn_mva\",\"vn_hv_kv\",\"vn_lv_kv\",\"vk_percent\",\"vkr_percent\",\"pfe_kw\",\"i0_percent\",\"shift_degree\",\"tap_side\",\"tap_neutral\",\"tap_min\",\"tap_max\",\"tap_step_percent\",\"tap_step_degree\",\"tap_pos\",\"tap_phase_shifter\",\"parallel\",\"df\",\"in_service\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "std_type": "object", + "hv_bus": "uint32", + "lv_bus": "uint32", + "sn_mva": "float64", + "vn_hv_kv": "float64", + "vn_lv_kv": "float64", + "vk_percent": "float64", + "vkr_percent": "float64", + "pfe_kw": "float64", + "i0_percent": "float64", + "shift_degree": "float64", + "tap_side": "object", + "tap_neutral": "int32", + "tap_min": "int32", + "tap_max": "int32", + "tap_step_percent": "float64", + "tap_step_degree": "float64", + "tap_pos": "int32", + "tap_phase_shifter": "bool", + "parallel": "uint32", + "df": "float64", + "in_service": "bool" + } + }, + "trafo3w": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"std_type\",\"hv_bus\",\"mv_bus\",\"lv_bus\",\"sn_hv_mva\",\"sn_mv_mva\",\"sn_lv_mva\",\"vn_hv_kv\",\"vn_mv_kv\",\"vn_lv_kv\",\"vk_hv_percent\",\"vk_mv_percent\",\"vk_lv_percent\",\"vkr_hv_percent\",\"vkr_mv_percent\",\"vkr_lv_percent\",\"pfe_kw\",\"i0_percent\",\"shift_mv_degree\",\"shift_lv_degree\",\"tap_side\",\"tap_neutral\",\"tap_min\",\"tap_max\",\"tap_step_percent\",\"tap_step_degree\",\"tap_pos\",\"tap_at_star_point\",\"in_service\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "std_type": "object", + "hv_bus": "uint32", + "mv_bus": "uint32", + "lv_bus": "uint32", + "sn_hv_mva": "float64", + "sn_mv_mva": "float64", + "sn_lv_mva": "float64", + "vn_hv_kv": "float64", + "vn_mv_kv": "float64", + "vn_lv_kv": "float64", + "vk_hv_percent": "float64", + "vk_mv_percent": "float64", + "vk_lv_percent": "float64", + "vkr_hv_percent": "float64", + "vkr_mv_percent": "float64", + "vkr_lv_percent": "float64", + "pfe_kw": "float64", + "i0_percent": "float64", + "shift_mv_degree": "float64", + "shift_lv_degree": "float64", + "tap_side": "object", + "tap_neutral": "int32", + "tap_min": "int32", + "tap_max": "int32", + "tap_step_percent": "float64", + "tap_step_degree": "float64", + "tap_pos": "int32", + "tap_at_star_point": "bool", + "in_service": "bool" + } + }, + "impedance": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"from_bus\",\"to_bus\",\"rft_pu\",\"xft_pu\",\"rtf_pu\",\"xtf_pu\",\"sn_mva\",\"in_service\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "from_bus": "uint32", + "to_bus": "uint32", + "rft_pu": "float64", + "xft_pu": "float64", + "rtf_pu": "float64", + "xtf_pu": "float64", + "sn_mva": "float64", + "in_service": "bool" + } + }, + "dcline": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"from_bus\",\"to_bus\",\"p_mw\",\"loss_percent\",\"loss_mw\",\"vm_from_pu\",\"vm_to_pu\",\"max_p_mw\",\"min_q_from_mvar\",\"min_q_to_mvar\",\"max_q_from_mvar\",\"max_q_to_mvar\",\"in_service\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "from_bus": "uint32", + "to_bus": "uint32", + "p_mw": "float64", + "loss_percent": "float64", + "loss_mw": "float64", + "vm_from_pu": "float64", + "vm_to_pu": "float64", + "max_p_mw": "float64", + "min_q_from_mvar": "float64", + "min_q_to_mvar": "float64", + "max_q_from_mvar": "float64", + "max_q_to_mvar": "float64", + "in_service": "bool" + } + }, + "ward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"ps_mw\",\"qs_mvar\",\"qz_mvar\",\"pz_mw\",\"in_service\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "uint32", + "ps_mw": "float64", + "qs_mvar": "float64", + "qz_mvar": "float64", + "pz_mw": "float64", + "in_service": "bool" + } + }, + "xward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"bus\",\"ps_mw\",\"qs_mvar\",\"qz_mvar\",\"pz_mw\",\"r_ohm\",\"x_ohm\",\"vm_pu\",\"in_service\",\"slack_weight\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "bus": "uint32", + "ps_mw": "float64", + "qs_mvar": "float64", + "qz_mvar": "float64", + "pz_mw": "float64", + "r_ohm": "float64", + "x_ohm": "float64", + "vm_pu": "float64", + "in_service": "bool", + "slack_weight": "float64" + } + }, + "measurement": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"measurement_type\",\"element_type\",\"element\",\"value\",\"std_dev\",\"side\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "name": "object", + "measurement_type": "object", + "element_type": "object", + "element": "uint32", + "value": "float64", + "std_dev": "float64", + "side": "object" + } + }, + "pwl_cost": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"power_type\",\"element\",\"et\",\"points\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "power_type": "object", + "element": "uint32", + "et": "object", + "points": "object" + } + }, + "poly_cost": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"element\",\"et\",\"cp0_eur\",\"cp1_eur_per_mw\",\"cp2_eur_per_mw2\",\"cq0_eur\",\"cq1_eur_per_mvar\",\"cq2_eur_per_mvar2\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "element": "uint32", + "et": "object", + "cp0_eur": "float64", + "cp1_eur_per_mw": "float64", + "cp2_eur_per_mw2": "float64", + "cq0_eur": "float64", + "cq1_eur_per_mvar": "float64", + "cq2_eur_per_mvar2": "float64" + } + }, + "characteristic": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"object\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "object": "object" + } + }, + "controller": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"object\",\"in_service\",\"order\",\"level\",\"initial_run\",\"recycle\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "object": "object", + "in_service": "bool", + "order": "float64", + "level": "object", + "initial_run": "bool", + "recycle": "object" + } + }, + "line_geodata": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"coords\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[[[0,0],[0,4]]],[[[0,0],[2,4]]],[[[0,0],[4,4]]],[[[0,0],[4,0]]],[[[0,4],[2,4]]],[[[2,4],[3,4.2],[4,4]]],[[[2,4],[3,3.8],[4,4]]],[[[4,4],[4,0]]]]}", + "orient": "split", + "dtype": { + "coords": "object" + } + }, + "bus_geodata": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"x\",\"y\",\"coords\"],\"index\":[0,1,2,3,4],\"data\":[[0.0,0.0,null],[0.0,4.0,null],[2.0,4.0,null],[4.0,4.0,null],[4.0,0.0,null]]}", + "orient": "split", + "dtype": { + "x": "float64", + "y": "float64", + "coords": "object" + } + }, + "version": "2.8.0", + "converged": true, + "name": "5bus", + "f_hz": 50.0, + "sn_mva": 1, + "std_types": { + "line": { + "NAYY 4x50 SE": { + "c_nf_per_km": 210, + "r_ohm_per_km": 0.642, + "x_ohm_per_km": 0.083, + "max_i_ka": 0.142, + "type": "cs", + "q_mm2": 50, + "alpha": 0.00403 + }, + "NAYY 4x120 SE": { + "c_nf_per_km": 264, + "r_ohm_per_km": 0.225, + "x_ohm_per_km": 0.08, + "max_i_ka": 0.242, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00403 + }, + "NAYY 4x150 SE": { + "c_nf_per_km": 261, + "r_ohm_per_km": 0.208, + "x_ohm_per_km": 0.08, + "max_i_ka": 0.27, + "type": "cs", + "q_mm2": 150, + "alpha": 0.00403 + }, + "NA2XS2Y 1x95 RM/25 12/20 kV": { + "c_nf_per_km": 216, + "r_ohm_per_km": 0.313, + "x_ohm_per_km": 0.132, + "max_i_ka": 0.252, + "type": "cs", + "q_mm2": 95, + "alpha": 0.00403 + }, + "NA2XS2Y 1x185 RM/25 12/20 kV": { + "c_nf_per_km": 273, + "r_ohm_per_km": 0.161, + "x_ohm_per_km": 0.117, + "max_i_ka": 0.362, + "type": "cs", + "q_mm2": 185, + "alpha": 0.00403 + }, + "NA2XS2Y 1x240 RM/25 12/20 kV": { + "c_nf_per_km": 304, + "r_ohm_per_km": 0.122, + "x_ohm_per_km": 0.112, + "max_i_ka": 0.421, + "type": "cs", + "q_mm2": 240, + "alpha": 0.00403 + }, + "NA2XS2Y 1x95 RM/25 6/10 kV": { + "c_nf_per_km": 315, + "r_ohm_per_km": 0.313, + "x_ohm_per_km": 0.123, + "max_i_ka": 0.249, + "type": "cs", + "q_mm2": 95, + "alpha": 0.00403 + }, + "NA2XS2Y 1x185 RM/25 6/10 kV": { + "c_nf_per_km": 406, + "r_ohm_per_km": 0.161, + "x_ohm_per_km": 0.11, + "max_i_ka": 0.358, + "type": "cs", + "q_mm2": 185, + "alpha": 0.00403 + }, + "NA2XS2Y 1x240 RM/25 6/10 kV": { + "c_nf_per_km": 456, + "r_ohm_per_km": 0.122, + "x_ohm_per_km": 0.105, + "max_i_ka": 0.416, + "type": "cs", + "q_mm2": 240, + "alpha": 0.00403 + }, + "NA2XS2Y 1x150 RM/25 12/20 kV": { + "c_nf_per_km": 250, + "r_ohm_per_km": 0.206, + "x_ohm_per_km": 0.116, + "max_i_ka": 0.319, + "type": "cs", + "q_mm2": 150, + "alpha": 0.00403 + }, + "NA2XS2Y 1x120 RM/25 12/20 kV": { + "c_nf_per_km": 230, + "r_ohm_per_km": 0.253, + "x_ohm_per_km": 0.119, + "max_i_ka": 0.283, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00403 + }, + "NA2XS2Y 1x70 RM/25 12/20 kV": { + "c_nf_per_km": 190, + "r_ohm_per_km": 0.443, + "x_ohm_per_km": 0.132, + "max_i_ka": 0.22, + "type": "cs", + "q_mm2": 70, + "alpha": 0.00403 + }, + "NA2XS2Y 1x150 RM/25 6/10 kV": { + "c_nf_per_km": 360, + "r_ohm_per_km": 0.206, + "x_ohm_per_km": 0.11, + "max_i_ka": 0.315, + "type": "cs", + "q_mm2": 150, + "alpha": 0.00403 + }, + "NA2XS2Y 1x120 RM/25 6/10 kV": { + "c_nf_per_km": 340, + "r_ohm_per_km": 0.253, + "x_ohm_per_km": 0.113, + "max_i_ka": 0.28, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00403 + }, + "NA2XS2Y 1x70 RM/25 6/10 kV": { + "c_nf_per_km": 280, + "r_ohm_per_km": 0.443, + "x_ohm_per_km": 0.123, + "max_i_ka": 0.217, + "type": "cs", + "q_mm2": 70, + "alpha": 0.00403 + }, + "N2XS(FL)2Y 1x120 RM/35 64/110 kV": { + "c_nf_per_km": 112, + "r_ohm_per_km": 0.153, + "x_ohm_per_km": 0.166, + "max_i_ka": 0.366, + "type": "cs", + "q_mm2": 120, + "alpha": 0.00393 + }, + "N2XS(FL)2Y 1x185 RM/35 64/110 kV": { + "c_nf_per_km": 125, + "r_ohm_per_km": 0.099, + "x_ohm_per_km": 0.156, + "max_i_ka": 0.457, + "type": "cs", + "q_mm2": 185, + "alpha": 0.00393 + }, + "N2XS(FL)2Y 1x240 RM/35 64/110 kV": { + "c_nf_per_km": 135, + "r_ohm_per_km": 0.075, + "x_ohm_per_km": 0.149, + "max_i_ka": 0.526, + "type": "cs", + "q_mm2": 240, + "alpha": 0.00393 + }, + "N2XS(FL)2Y 1x300 RM/35 64/110 kV": { + "c_nf_per_km": 144, + "r_ohm_per_km": 0.06, + "x_ohm_per_km": 0.144, + "max_i_ka": 0.588, + "type": "cs", + "q_mm2": 300, + "alpha": 0.00393 + }, + "15-AL1/3-ST1A 0.4": { + "c_nf_per_km": 11, + "r_ohm_per_km": 1.8769, + "x_ohm_per_km": 0.35, + "max_i_ka": 0.105, + "type": "ol", + "q_mm2": 16, + "alpha": 0.00403 + }, + "24-AL1/4-ST1A 0.4": { + "c_nf_per_km": 11.25, + "r_ohm_per_km": 1.2012, + "x_ohm_per_km": 0.335, + "max_i_ka": 0.14, + "type": "ol", + "q_mm2": 24, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 0.4": { + "c_nf_per_km": 12.2, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.3, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 0.4": { + "c_nf_per_km": 13.2, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.29, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "34-AL1/6-ST1A 10.0": { + "c_nf_per_km": 9.7, + "r_ohm_per_km": 0.8342, + "x_ohm_per_km": 0.36, + "max_i_ka": 0.17, + "type": "ol", + "q_mm2": 34, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 10.0": { + "c_nf_per_km": 10.1, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.35, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "70-AL1/11-ST1A 10.0": { + "c_nf_per_km": 10.4, + "r_ohm_per_km": 0.4132, + "x_ohm_per_km": 0.339, + "max_i_ka": 0.29, + "type": "ol", + "q_mm2": 70, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 10.0": { + "c_nf_per_km": 10.75, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.33, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "122-AL1/20-ST1A 10.0": { + "c_nf_per_km": 11.1, + "r_ohm_per_km": 0.2376, + "x_ohm_per_km": 0.323, + "max_i_ka": 0.41, + "type": "ol", + "q_mm2": 122, + "alpha": 0.00403 + }, + "149-AL1/24-ST1A 10.0": { + "c_nf_per_km": 11.25, + "r_ohm_per_km": 0.194, + "x_ohm_per_km": 0.315, + "max_i_ka": 0.47, + "type": "ol", + "q_mm2": 149, + "alpha": 0.00403 + }, + "34-AL1/6-ST1A 20.0": { + "c_nf_per_km": 9.15, + "r_ohm_per_km": 0.8342, + "x_ohm_per_km": 0.382, + "max_i_ka": 0.17, + "type": "ol", + "q_mm2": 34, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 20.0": { + "c_nf_per_km": 9.5, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.372, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "70-AL1/11-ST1A 20.0": { + "c_nf_per_km": 9.7, + "r_ohm_per_km": 0.4132, + "x_ohm_per_km": 0.36, + "max_i_ka": 0.29, + "type": "ol", + "q_mm2": 70, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 20.0": { + "c_nf_per_km": 10, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.35, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "122-AL1/20-ST1A 20.0": { + "c_nf_per_km": 10.3, + "r_ohm_per_km": 0.2376, + "x_ohm_per_km": 0.344, + "max_i_ka": 0.41, + "type": "ol", + "q_mm2": 122, + "alpha": 0.00403 + }, + "149-AL1/24-ST1A 20.0": { + "c_nf_per_km": 10.5, + "r_ohm_per_km": 0.194, + "x_ohm_per_km": 0.337, + "max_i_ka": 0.47, + "type": "ol", + "q_mm2": 149, + "alpha": 0.00403 + }, + "184-AL1/30-ST1A 20.0": { + "c_nf_per_km": 10.75, + "r_ohm_per_km": 0.1571, + "x_ohm_per_km": 0.33, + "max_i_ka": 0.535, + "type": "ol", + "q_mm2": 184, + "alpha": 0.00403 + }, + "243-AL1/39-ST1A 20.0": { + "c_nf_per_km": 11, + "r_ohm_per_km": 0.1188, + "x_ohm_per_km": 0.32, + "max_i_ka": 0.645, + "type": "ol", + "q_mm2": 243, + "alpha": 0.00403 + }, + "48-AL1/8-ST1A 110.0": { + "c_nf_per_km": 8, + "r_ohm_per_km": 0.5939, + "x_ohm_per_km": 0.46, + "max_i_ka": 0.21, + "type": "ol", + "q_mm2": 48, + "alpha": 0.00403 + }, + "70-AL1/11-ST1A 110.0": { + "c_nf_per_km": 8.4, + "r_ohm_per_km": 0.4132, + "x_ohm_per_km": 0.45, + "max_i_ka": 0.29, + "type": "ol", + "q_mm2": 70, + "alpha": 0.00403 + }, + "94-AL1/15-ST1A 110.0": { + "c_nf_per_km": 8.65, + "r_ohm_per_km": 0.306, + "x_ohm_per_km": 0.44, + "max_i_ka": 0.35, + "type": "ol", + "q_mm2": 94, + "alpha": 0.00403 + }, + "122-AL1/20-ST1A 110.0": { + "c_nf_per_km": 8.5, + "r_ohm_per_km": 0.2376, + "x_ohm_per_km": 0.43, + "max_i_ka": 0.41, + "type": "ol", + "q_mm2": 122, + "alpha": 0.00403 + }, + "149-AL1/24-ST1A 110.0": { + "c_nf_per_km": 8.75, + "r_ohm_per_km": 0.194, + "x_ohm_per_km": 0.41, + "max_i_ka": 0.47, + "type": "ol", + "q_mm2": 149, + "alpha": 0.00403 + }, + "184-AL1/30-ST1A 110.0": { + "c_nf_per_km": 8.8, + "r_ohm_per_km": 0.1571, + "x_ohm_per_km": 0.4, + "max_i_ka": 0.535, + "type": "ol", + "q_mm2": 184, + "alpha": 0.00403 + }, + "243-AL1/39-ST1A 110.0": { + "c_nf_per_km": 9, + "r_ohm_per_km": 0.1188, + "x_ohm_per_km": 0.39, + "max_i_ka": 0.645, + "type": "ol", + "q_mm2": 243, + "alpha": 0.00403 + }, + "305-AL1/39-ST1A 110.0": { + "c_nf_per_km": 9.2, + "r_ohm_per_km": 0.0949, + "x_ohm_per_km": 0.38, + "max_i_ka": 0.74, + "type": "ol", + "q_mm2": 305, + "alpha": 0.00403 + }, + "490-AL1/64-ST1A 110.0": { + "c_nf_per_km": 9.75, + "r_ohm_per_km": 0.059, + "x_ohm_per_km": 0.37, + "max_i_ka": 0.96, + "type": "ol", + "q_mm2": 490, + "alpha": 0.00403 + }, + "679-AL1/86-ST1A 110.0": { + "c_nf_per_km": 9.95, + "r_ohm_per_km": 0.042, + "x_ohm_per_km": 0.36, + "max_i_ka": 0.115, + "type": "ol", + "q_mm2": 679, + "alpha": 0.00403 + }, + "490-AL1/64-ST1A 220.0": { + "c_nf_per_km": 10, + "r_ohm_per_km": 0.059, + "x_ohm_per_km": 0.285, + "max_i_ka": 0.96, + "type": "ol", + "q_mm2": 490, + "alpha": 0.00403 + }, + "679-AL1/86-ST1A 220.0": { + "c_nf_per_km": 11.7, + "r_ohm_per_km": 0.042, + "x_ohm_per_km": 0.275, + "max_i_ka": 0.115, + "type": "ol", + "q_mm2": 679, + "alpha": 0.00403 + }, + "490-AL1/64-ST1A 380.0": { + "c_nf_per_km": 11, + "r_ohm_per_km": 0.059, + "x_ohm_per_km": 0.253, + "max_i_ka": 0.96, + "type": "ol", + "q_mm2": 490, + "alpha": 0.00403 + }, + "679-AL1/86-ST1A 380.0": { + "c_nf_per_km": 14.6, + "r_ohm_per_km": 0.042, + "x_ohm_per_km": 0.25, + "max_i_ka": 0.115, + "type": "ol", + "q_mm2": 679, + "alpha": 0.00403 + } + }, + "trafo": { + "160 MVA 380/110 kV": { + "i0_percent": 0.06, + "pfe_kw": 60, + "vkr_percent": 0.25, + "sn_mva": 160, + "vn_lv_kv": 110.0, + "vn_hv_kv": 380.0, + "vk_percent": 12.2, + "shift_degree": 0, + "vector_group": "Yy0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "100 MVA 220/110 kV": { + "i0_percent": 0.06, + "pfe_kw": 55, + "vkr_percent": 0.26, + "sn_mva": 100, + "vn_lv_kv": 110.0, + "vn_hv_kv": 220.0, + "vk_percent": 12.0, + "shift_degree": 0, + "vector_group": "Yy0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "63 MVA 110/20 kV": { + "i0_percent": 0.04, + "pfe_kw": 22, + "vkr_percent": 0.32, + "sn_mva": 63, + "vn_lv_kv": 20.0, + "vn_hv_kv": 110.0, + "vk_percent": 18, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "40 MVA 110/20 kV": { + "i0_percent": 0.05, + "pfe_kw": 18, + "vkr_percent": 0.34, + "sn_mva": 40, + "vn_lv_kv": 20.0, + "vn_hv_kv": 110.0, + "vk_percent": 16.2, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "25 MVA 110/20 kV": { + "i0_percent": 0.07, + "pfe_kw": 14, + "vkr_percent": 0.41, + "sn_mva": 25, + "vn_lv_kv": 20.0, + "vn_hv_kv": 110.0, + "vk_percent": 12, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "63 MVA 110/10 kV": { + "sn_mva": 63, + "vn_hv_kv": 110, + "vn_lv_kv": 10, + "vk_percent": 18, + "vkr_percent": 0.32, + "pfe_kw": 22, + "i0_percent": 0.04, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "40 MVA 110/10 kV": { + "sn_mva": 40, + "vn_hv_kv": 110, + "vn_lv_kv": 10, + "vk_percent": 16.2, + "vkr_percent": 0.34, + "pfe_kw": 18, + "i0_percent": 0.05, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "25 MVA 110/10 kV": { + "sn_mva": 25, + "vn_hv_kv": 110, + "vn_lv_kv": 10, + "vk_percent": 12, + "vkr_percent": 0.41, + "pfe_kw": 14, + "i0_percent": 0.07, + "shift_degree": 150, + "vector_group": "YNd5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -9, + "tap_max": 9, + "tap_step_degree": 0, + "tap_step_percent": 1.5, + "tap_phase_shifter": false + }, + "0.25 MVA 20/0.4 kV": { + "sn_mva": 0.25, + "vn_hv_kv": 20, + "vn_lv_kv": 0.4, + "vk_percent": 6, + "vkr_percent": 1.44, + "pfe_kw": 0.8, + "i0_percent": 0.32, + "shift_degree": 150, + "vector_group": "Yzn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.4 MVA 20/0.4 kV": { + "sn_mva": 0.4, + "vn_hv_kv": 20, + "vn_lv_kv": 0.4, + "vk_percent": 6, + "vkr_percent": 1.425, + "pfe_kw": 1.35, + "i0_percent": 0.3375, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.63 MVA 20/0.4 kV": { + "sn_mva": 0.63, + "vn_hv_kv": 20, + "vn_lv_kv": 0.4, + "vk_percent": 6, + "vkr_percent": 1.206, + "pfe_kw": 1.65, + "i0_percent": 0.2619, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.25 MVA 10/0.4 kV": { + "sn_mva": 0.25, + "vn_hv_kv": 10, + "vn_lv_kv": 0.4, + "vk_percent": 4, + "vkr_percent": 1.2, + "pfe_kw": 0.6, + "i0_percent": 0.24, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.4 MVA 10/0.4 kV": { + "sn_mva": 0.4, + "vn_hv_kv": 10, + "vn_lv_kv": 0.4, + "vk_percent": 4, + "vkr_percent": 1.325, + "pfe_kw": 0.95, + "i0_percent": 0.2375, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + }, + "0.63 MVA 10/0.4 kV": { + "sn_mva": 0.63, + "vn_hv_kv": 10, + "vn_lv_kv": 0.4, + "vk_percent": 4, + "vkr_percent": 1.0794, + "pfe_kw": 1.18, + "i0_percent": 0.1873, + "shift_degree": 150, + "vector_group": "Dyn5", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -2, + "tap_max": 2, + "tap_step_degree": 0, + "tap_step_percent": 2.5, + "tap_phase_shifter": false + } + }, + "trafo3w": { + "63/25/38 MVA 110/20/10 kV": { + "sn_hv_mva": 63, + "sn_mv_mva": 25, + "sn_lv_mva": 38, + "vn_hv_kv": 110, + "vn_mv_kv": 20, + "vn_lv_kv": 10, + "vk_hv_percent": 10.4, + "vk_mv_percent": 10.4, + "vk_lv_percent": 10.4, + "vkr_hv_percent": 0.28, + "vkr_mv_percent": 0.32, + "vkr_lv_percent": 0.35, + "pfe_kw": 35, + "i0_percent": 0.89, + "shift_mv_degree": 0, + "shift_lv_degree": 0, + "vector_group": "YN0yn0yn0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -10, + "tap_max": 10, + "tap_step_percent": 1.2 + }, + "63/25/38 MVA 110/10/10 kV": { + "sn_hv_mva": 63, + "sn_mv_mva": 25, + "sn_lv_mva": 38, + "vn_hv_kv": 110, + "vn_mv_kv": 10, + "vn_lv_kv": 10, + "vk_hv_percent": 10.4, + "vk_mv_percent": 10.4, + "vk_lv_percent": 10.4, + "vkr_hv_percent": 0.28, + "vkr_mv_percent": 0.32, + "vkr_lv_percent": 0.35, + "pfe_kw": 35, + "i0_percent": 0.89, + "shift_mv_degree": 0, + "shift_lv_degree": 0, + "vector_group": "YN0yn0yn0", + "tap_side": "hv", + "tap_neutral": 0, + "tap_min": -10, + "tap_max": 10, + "tap_step_percent": 1.2 + } + } + }, + "res_bus": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"vm_pu\",\"va_degree\",\"p_mw\",\"q_mvar\"],\"index\":[0,1,2,3,4],\"data\":[[1.02,-0.845445168673926,0.0,-111.791243672370911],[1.02,0.0,-21.729831330858325,116.839935541152954],[1.019214100496144,-0.409103297622625,0.0,0.0],[1.018637116919488,-0.503470352662766,10.0,7.0],[1.017983079721402,-0.653497665026562,10.0,7.0]]}", + "orient": "split", + "dtype": { + "vm_pu": "float64", + "va_degree": "float64", + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_line": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"ql_mvar\",\"i_from_ka\",\"i_to_ka\",\"i_ka\",\"vm_from_pu\",\"va_from_degree\",\"vm_to_pu\",\"va_to_degree\",\"loading_percent\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[-7.167647147657727,57.480079867900443,8.03525639977348,-60.113463233922118,0.867609252115754,-2.633383366021676,0.327874112511858,0.343286326507116,0.343286326507116,1.02,-0.845445168673926,1.02,0.0,57.214387751185988],[-0.657313913963437,25.969126903729045,0.866078469150186,-29.007927174007612,0.208764555186749,-3.038800270278568,0.147040043868819,0.164393305610081,0.164393305610081,1.02,-0.845445168673926,1.019214100496144,-0.409103297622625,74.724229822763931],[1.64566972119938,15.370129751576128,-1.540268914180618,-19.229415550834709,0.105400807018762,-3.859285799258581,0.087496748884432,0.109338903896103,0.109338903896103,1.02,-0.845445168673926,1.018637116919488,-0.503470352662766,68.336814935064211],[6.179291340421495,12.971907266349552,-6.119076735247816,-15.70424981919658,0.060214605173678,-2.732342552847028,0.081330018729726,0.095589209712924,0.095589209712924,1.02,-0.845445168673926,1.017983079721402,-0.653497665026562,59.743256070577175],[13.694574931085771,-56.726472302863066,-13.283848894885464,55.407854241119566,0.410726036200307,-1.3186180617435,0.330312825878128,0.322760996590474,0.330312825878128,1.02,0.0,1.019214100496144,-0.409103297622625,55.052137646354595],[6.208885212872048,-13.199963533555254,-6.184761786109662,11.833197159642042,0.024123426762386,-1.366766373913212,0.082632108556076,0.075677384410291,0.082632108556076,1.019214100496144,-0.409103297622625,1.018637116919488,-0.503470352662766,27.544036185358689],[6.208885212872048,-13.199963533555254,-6.184761786109662,11.833197159642042,0.024123426762386,-1.366766373913212,0.082632108556076,0.075677384410291,0.082632108556076,1.019214100496144,-0.409103297622625,1.018637116919488,-0.503470352662766,27.544036185358689],[3.909792486391969,-11.436978768449999,-3.88092326475316,8.704249819196738,0.028869221638809,-2.732728949253261,0.068506463438984,0.054050881891821,0.068506463438984,1.018637116919488,-0.503470352662766,1.017983079721402,-0.653497665026562,42.816539649365005]]}", + "orient": "split", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_from_ka": "float64", + "i_to_ka": "float64", + "i_ka": "float64", + "vm_from_pu": "float64", + "va_from_degree": "float64", + "vm_to_pu": "float64", + "va_to_degree": "float64", + "loading_percent": "float64" + } + }, + "res_trafo": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_hv_mw\",\"q_hv_mvar\",\"p_lv_mw\",\"q_lv_mvar\",\"pl_mw\",\"ql_mvar\",\"i_hv_ka\",\"i_lv_ka\",\"vm_hv_pu\",\"va_hv_degree\",\"vm_lv_pu\",\"va_lv_degree\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_hv_mw": "float64", + "q_hv_mvar": "float64", + "p_lv_mw": "float64", + "q_lv_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_hv_ka": "float64", + "i_lv_ka": "float64", + "vm_hv_pu": "float64", + "va_hv_degree": "float64", + "vm_lv_pu": "float64", + "va_lv_degree": "float64", + "loading_percent": "float64" + } + }, + "res_trafo3w": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_hv_mw\",\"q_hv_mvar\",\"p_mv_mw\",\"q_mv_mvar\",\"p_lv_mw\",\"q_lv_mvar\",\"pl_mw\",\"ql_mvar\",\"i_hv_ka\",\"i_mv_ka\",\"i_lv_ka\",\"vm_hv_pu\",\"va_hv_degree\",\"vm_mv_pu\",\"va_mv_degree\",\"vm_lv_pu\",\"va_lv_degree\",\"va_internal_degree\",\"vm_internal_pu\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_hv_mw": "float64", + "q_hv_mvar": "float64", + "p_mv_mw": "float64", + "q_mv_mvar": "float64", + "p_lv_mw": "float64", + "q_lv_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_hv_ka": "float64", + "i_mv_ka": "float64", + "i_lv_ka": "float64", + "vm_hv_pu": "float64", + "va_hv_degree": "float64", + "vm_mv_pu": "float64", + "va_mv_degree": "float64", + "vm_lv_pu": "float64", + "va_lv_degree": "float64", + "va_internal_degree": "float64", + "vm_internal_pu": "float64", + "loading_percent": "float64" + } + }, + "res_impedance": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"ql_mvar\",\"i_from_ka\",\"i_to_ka\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_from_ka": "float64", + "i_to_ka": "float64" + } + }, + "res_ext_grid": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_load": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[0,1,2],\"data\":[[10.0,7.0],[10.0,7.0],[10.0,7.0]]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_motor": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_sgen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_storage": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_shunt": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"vm_pu\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "vm_pu": "float64" + } + }, + "res_gen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"va_degree\",\"vm_pu\"],\"index\":[0,1],\"data\":[[10.0,118.791243672370911,-0.845445168673926,1.02],[21.729831330858325,-116.839935541152954,0.0,1.02]]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "va_degree": "float64", + "vm_pu": "float64" + } + }, + "res_ward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"vm_pu\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "vm_pu": "float64" + } + }, + "res_xward": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\",\"vm_pu\",\"va_internal_degree\",\"vm_internal_pu\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64", + "vm_pu": "float64", + "va_internal_degree": "float64", + "vm_internal_pu": "float64" + } + }, + "res_dcline": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"vm_from_pu\",\"va_from_degree\",\"vm_to_pu\",\"va_to_degree\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "vm_from_pu": "float64", + "va_from_degree": "float64", + "vm_to_pu": "float64", + "va_to_degree": "float64" + } + }, + "res_asymmetric_load": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_asymmetric_sgen": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_bus_est": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"vm_pu\",\"va_degree\",\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "vm_pu": "float64", + "va_degree": "float64", + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_line_est": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"ql_mvar\",\"i_from_ka\",\"i_to_ka\",\"i_ka\",\"vm_from_pu\",\"va_from_degree\",\"vm_to_pu\",\"va_to_degree\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_from_ka": "float64", + "i_to_ka": "float64", + "i_ka": "float64", + "vm_from_pu": "float64", + "va_from_degree": "float64", + "vm_to_pu": "float64", + "va_to_degree": "float64", + "loading_percent": "float64" + } + }, + "res_trafo_est": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_hv_mw\",\"q_hv_mvar\",\"p_lv_mw\",\"q_lv_mvar\",\"pl_mw\",\"ql_mvar\",\"i_hv_ka\",\"i_lv_ka\",\"vm_hv_pu\",\"va_hv_degree\",\"vm_lv_pu\",\"va_lv_degree\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_hv_mw": "float64", + "q_hv_mvar": "float64", + "p_lv_mw": "float64", + "q_lv_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_hv_ka": "float64", + "i_lv_ka": "float64", + "vm_hv_pu": "float64", + "va_hv_degree": "float64", + "vm_lv_pu": "float64", + "va_lv_degree": "float64", + "loading_percent": "float64" + } + }, + "res_trafo3w_est": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_hv_mw\",\"q_hv_mvar\",\"p_mv_mw\",\"q_mv_mvar\",\"p_lv_mw\",\"q_lv_mvar\",\"pl_mw\",\"ql_mvar\",\"i_hv_ka\",\"i_mv_ka\",\"i_lv_ka\",\"vm_hv_pu\",\"va_hv_degree\",\"vm_mv_pu\",\"va_mv_degree\",\"vm_lv_pu\",\"va_lv_degree\",\"va_internal_degree\",\"vm_internal_pu\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_hv_mw": "float64", + "q_hv_mvar": "float64", + "p_mv_mw": "float64", + "q_mv_mvar": "float64", + "p_lv_mw": "float64", + "q_lv_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_hv_ka": "float64", + "i_mv_ka": "float64", + "i_lv_ka": "float64", + "vm_hv_pu": "float64", + "va_hv_degree": "float64", + "vm_mv_pu": "float64", + "va_mv_degree": "float64", + "vm_lv_pu": "float64", + "va_lv_degree": "float64", + "va_internal_degree": "float64", + "vm_internal_pu": "float64", + "loading_percent": "float64" + } + }, + "res_impedance_est": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_from_mw\",\"q_from_mvar\",\"p_to_mw\",\"q_to_mvar\",\"pl_mw\",\"ql_mvar\",\"i_from_ka\",\"i_to_ka\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_from_mw": "float64", + "q_from_mvar": "float64", + "p_to_mw": "float64", + "q_to_mvar": "float64", + "pl_mw": "float64", + "ql_mvar": "float64", + "i_from_ka": "float64", + "i_to_ka": "float64" + } + }, + "res_bus_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_line_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_trafo_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_trafo3w_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_ext_grid_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_gen_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_sgen_sc": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_bus_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"vm_a_pu\",\"va_a_degree\",\"vm_b_pu\",\"va_b_degree\",\"vm_c_pu\",\"va_c_degree\",\"p_a_mw\",\"q_a_mvar\",\"p_b_mw\",\"q_b_mvar\",\"p_c_mw\",\"q_c_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "vm_a_pu": "float64", + "va_a_degree": "float64", + "vm_b_pu": "float64", + "va_b_degree": "float64", + "vm_c_pu": "float64", + "va_c_degree": "float64", + "p_a_mw": "float64", + "q_a_mvar": "float64", + "p_b_mw": "float64", + "q_b_mvar": "float64", + "p_c_mw": "float64", + "q_c_mvar": "float64" + } + }, + "res_line_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_a_from_mw\",\"q_a_from_mvar\",\"p_b_from_mw\",\"q_b_from_mvar\",\"q_c_from_mvar\",\"p_a_to_mw\",\"q_a_to_mvar\",\"p_b_to_mw\",\"q_b_to_mvar\",\"p_c_to_mw\",\"q_c_to_mvar\",\"p_a_l_mw\",\"q_a_l_mvar\",\"p_b_l_mw\",\"q_b_l_mvar\",\"p_c_l_mw\",\"q_c_l_mvar\",\"i_a_from_ka\",\"i_a_to_ka\",\"i_b_from_ka\",\"i_b_to_ka\",\"i_c_from_ka\",\"i_c_to_ka\",\"i_a_ka\",\"i_b_ka\",\"i_c_ka\",\"i_n_from_ka\",\"i_n_to_ka\",\"i_n_ka\",\"loading_a_percent\",\"loading_b_percent\",\"loading_c_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_a_from_mw": "float64", + "q_a_from_mvar": "float64", + "p_b_from_mw": "float64", + "q_b_from_mvar": "float64", + "q_c_from_mvar": "float64", + "p_a_to_mw": "float64", + "q_a_to_mvar": "float64", + "p_b_to_mw": "float64", + "q_b_to_mvar": "float64", + "p_c_to_mw": "float64", + "q_c_to_mvar": "float64", + "p_a_l_mw": "float64", + "q_a_l_mvar": "float64", + "p_b_l_mw": "float64", + "q_b_l_mvar": "float64", + "p_c_l_mw": "float64", + "q_c_l_mvar": "float64", + "i_a_from_ka": "float64", + "i_a_to_ka": "float64", + "i_b_from_ka": "float64", + "i_b_to_ka": "float64", + "i_c_from_ka": "float64", + "i_c_to_ka": "float64", + "i_a_ka": "float64", + "i_b_ka": "float64", + "i_c_ka": "float64", + "i_n_from_ka": "float64", + "i_n_to_ka": "float64", + "i_n_ka": "float64", + "loading_a_percent": "float64", + "loading_b_percent": "float64", + "loading_c_percent": "float64" + } + }, + "res_trafo_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_a_hv_mw\",\"q_a_hv_mvar\",\"p_b_hv_mw\",\"q_b_hv_mvar\",\"p_c_hv_mw\",\"q_c_hv_mvar\",\"p_a_lv_mw\",\"q_a_lv_mvar\",\"p_b_lv_mw\",\"q_b_lv_mvar\",\"p_c_lv_mw\",\"q_c_lv_mvar\",\"p_a_l_mw\",\"q_a_l_mvar\",\"p_b_l_mw\",\"q_b_l_mvar\",\"p_c_l_mw\",\"q_c_l_mvar\",\"i_a_hv_ka\",\"i_a_lv_ka\",\"i_b_hv_ka\",\"i_b_lv_ka\",\"i_c_hv_ka\",\"i_c_lv_ka\",\"loading_a_percent\",\"loading_b_percent\",\"loading_c_percent\",\"loading_percent\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_a_hv_mw": "float64", + "q_a_hv_mvar": "float64", + "p_b_hv_mw": "float64", + "q_b_hv_mvar": "float64", + "p_c_hv_mw": "float64", + "q_c_hv_mvar": "float64", + "p_a_lv_mw": "float64", + "q_a_lv_mvar": "float64", + "p_b_lv_mw": "float64", + "q_b_lv_mvar": "float64", + "p_c_lv_mw": "float64", + "q_c_lv_mvar": "float64", + "p_a_l_mw": "float64", + "q_a_l_mvar": "float64", + "p_b_l_mw": "float64", + "q_b_l_mvar": "float64", + "p_c_l_mw": "float64", + "q_c_l_mvar": "float64", + "i_a_hv_ka": "float64", + "i_a_lv_ka": "float64", + "i_b_hv_ka": "float64", + "i_b_lv_ka": "float64", + "i_c_hv_ka": "float64", + "i_c_lv_ka": "float64", + "loading_a_percent": "float64", + "loading_b_percent": "float64", + "loading_c_percent": "float64", + "loading_percent": "float64" + } + }, + "res_ext_grid_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_a_mw\",\"q_a_mvar\",\"p_b_mw\",\"q_b_mvar\",\"p_c_mw\",\"q_c_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_a_mw": "float64", + "q_a_mvar": "float64", + "p_b_mw": "float64", + "q_b_mvar": "float64", + "p_c_mw": "float64", + "q_c_mvar": "float64" + } + }, + "res_shunt_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[],\"index\":[],\"data\":[]}", + "orient": "split" + }, + "res_load_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_sgen_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_storage_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_mw\",\"q_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_mw": "float64", + "q_mvar": "float64" + } + }, + "res_asymmetric_load_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_a_mw\",\"q_a_mvar\",\"p_b_mw\",\"q_b_mvar\",\"p_c_mw\",\"q_c_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_a_mw": "float64", + "q_a_mvar": "float64", + "p_b_mw": "float64", + "q_b_mvar": "float64", + "p_c_mw": "float64", + "q_c_mvar": "float64" + } + }, + "res_asymmetric_sgen_3ph": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"p_a_mw\",\"q_a_mvar\",\"p_b_mw\",\"q_b_mvar\",\"p_c_mw\",\"q_c_mvar\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "p_a_mw": "float64", + "q_a_mvar": "float64", + "p_b_mw": "float64", + "q_b_mvar": "float64", + "p_c_mw": "float64", + "q_c_mvar": "float64" + } + }, + "user_pf_options": {}, + "OPF_converged": false + } +} diff --git a/grid2op/data_test/5bus_example_disco_el_in_grid/prods_charac.csv b/grid2op/data_test/5bus_example_disco_el_in_grid/prods_charac.csv new file mode 100644 index 00000000..f47a9059 --- /dev/null +++ b/grid2op/data_test/5bus_example_disco_el_in_grid/prods_charac.csv @@ -0,0 +1,3 @@ +Pmax,Pmin,name,type,bus,max_ramp_up,max_ramp_down,min_up_time,min_down_time,marginal_cost,shut_down_cost,start_cost,x,y,V +15,0.0,gen_0_0,wind,5,0,0,0,0,0,0,0,0,0,102. +35,0.0,gen_1_1,thermal,0,15,15,4,4,70,1,2,0,400,102. \ No newline at end of file diff --git a/grid2op/tests/test_previous_state.py b/grid2op/tests/test_previous_state.py index 5caa753b..0d95f77a 100644 --- a/grid2op/tests/test_previous_state.py +++ b/grid2op/tests/test_previous_state.py @@ -7,6 +7,7 @@ # This file is part of Grid2Op, Grid2Op a testbed platform to model sequential decision making in power systems. import copy +import os from typing import Union import unittest import warnings @@ -17,6 +18,7 @@ import grid2op.Environment import grid2op.Environment._env_prev_state import grid2op.Observation +from grid2op.tests.helper_path_test import PATH_DATA_TEST class PreviousStateTester(unittest.TestCase): @@ -428,6 +430,139 @@ def test_shunt_for_env(self): # TODO pass + +class TestWithGridLineDisco(unittest.TestCase): + def setUp(self): + with warnings.catch_warnings(): + warnings.filterwarnings("ignore") + self.env = grid2op.make(os.path.join(PATH_DATA_TEST, "5bus_example_disco_el_in_grid")) + return super().setUp() + + def tearDown(self): + self.env.close() + return super().tearDown() + + def _aux_check_line_disco(self, line_id=2): + assert self.env._previous_conn_state._topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert self.env._previous_conn_state._topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + assert self.env._backend_action.current_topo.values[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert self.env._backend_action.current_topo.values[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + assert self.env._backend_action.last_topo_registered.values[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert self.env._backend_action.last_topo_registered.values[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + def test_env_ok(self): + self._aux_check_line_disco() + + obs = self.env.reset(seed=0, options={"time serie id": 0}) + self._aux_check_line_disco() + assert not obs.line_status[2] + assert obs.topo_vect[type(self.env).line_or_pos_topo_vect[2]] == -1 + assert obs.topo_vect[type(self.env).line_ex_pos_topo_vect[2]] == -1 + + self.env.step(self.env.action_space()) + self._aux_check_line_disco() + + def test_can_step_reco_with_bus(self): + line_id = 2 + obs = self.env.reset(seed=0, options={"time serie id": 0}) + act = self.env.action_space({"set_line_status": [(line_id, 1)], + "set_bus": {"lines_or_id": [(line_id, 1)], + "lines_ex_id": [(line_id, 1)], + }, + }) + obs, reward, done, info = self.env.step(act) + assert obs.line_status[line_id] + assert obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == 1 + assert obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == 1 + assert self.env._previous_conn_state._topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == 1 + assert self.env._previous_conn_state._topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == 1 + assert obs._prev_conn._topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == 1 + assert obs._prev_conn._topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == 1 + assert self.env._backend_action.current_topo.values[type(self.env).line_or_pos_topo_vect[line_id]] == 1 + assert self.env._backend_action.current_topo.values[type(self.env).line_ex_pos_topo_vect[line_id]] == 1 + assert self.env._backend_action.last_topo_registered.values[type(self.env).line_or_pos_topo_vect[line_id]] == 1 + assert self.env._backend_action.last_topo_registered.values[type(self.env).line_ex_pos_topo_vect[line_id]] == 1 + + def test_can_simulate_reco_with_bus(self): + line_id = 2 + obs = self.env.reset(seed=0, options={"time serie id": 0}) + sim_obs, reward, done, info = obs.simulate(self.env.action_space({"set_line_status": [(line_id, 1)], + "set_bus": {"lines_or_id": [(line_id, 1)], + "lines_ex_id": [(line_id, 1)], + }, + })) + assert sim_obs.line_status[2] + assert sim_obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == 1 + assert sim_obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == 1 + self._aux_check_line_disco() + assert obs._prev_conn._topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert obs._prev_conn._topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + def test_raise_exception_if_no_bus_step(self): + line_id = 2 + obs = self.env.reset(seed=0, options={"time serie id": 0}) + act = self.env.action_space({"set_line_status": [(line_id, 1)]}) + obs, reward, done, info = self.env.step(act) + assert len(info["exception"]) > 0 + self._aux_check_line_disco() + assert not obs.line_status[2] + assert obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + act = self.env.action_space({"set_line_status": [(line_id, 1)], + "set_bus": {"lines_or_id": [(line_id, 1)] + }, + }) + obs, reward, done, info = self.env.step(act) + assert len(info["exception"]) > 0 + self._aux_check_line_disco() + assert not obs.line_status[2] + assert obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + act = self.env.action_space({"set_line_status": [(line_id, 1)], + "set_bus": {"lines_ex_id": [(line_id, 1)] + }, + }) + obs, reward, done, info = self.env.step(act) + assert len(info["exception"]) > 0 + self._aux_check_line_disco() + assert not obs.line_status[2] + assert obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + def test_raise_exception_if_no_bus_simulate(self): + line_id = 2 + obs = self.env.reset(seed=0, options={"time serie id": 0}) + act = self.env.action_space({"set_line_status": [(line_id, 1)]}) + sim_obs, reward, done, info = obs.simulate(act) + assert len(info["exception"]) > 0 + self._aux_check_line_disco() + assert not sim_obs.line_status[2] + assert sim_obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert sim_obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + act = self.env.action_space({"set_line_status": [(line_id, 1)], + "set_bus": {"lines_or_id": [(line_id, 1)] + }, + }) + sim_obs, reward, done, info = obs.simulate(act) + assert len(info["exception"]) > 0 + self._aux_check_line_disco() + assert not sim_obs.line_status[2] + assert sim_obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert sim_obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + + act = self.env.action_space({"set_line_status": [(line_id, 1)], + "set_bus": {"lines_ex_id": [(line_id, 1)] + }, + }) + sim_obs, reward, done, info = obs.simulate(act) + assert len(info["exception"]) > 0 + self._aux_check_line_disco() + assert not sim_obs.line_status[2] + assert sim_obs.topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 + assert sim_obs.topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 # TODO shunt with obs.simulate and env.get_forecast_env # TODO storage with obs.simulate and env.get_forecast_env From 851dec1c0e25051c53aceab54fd9d844e4de6f81 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Tue, 3 Feb 2026 17:05:20 +0100 Subject: [PATCH 07/16] fix some issues with previous states: better consistency of environment topology - previous state and current state- and of shunt p,q setopint Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 2 + grid2op/Action/_backendAction.py | 7 + grid2op/Action/baseAction.py | 18 +-- grid2op/Backend/backend.py | 24 ++- grid2op/Backend/pandaPowerBackend.py | 200 ++++++++++++------------ grid2op/Environment/_env_prev_state.py | 71 +++++++-- grid2op/Environment/_obsEnv.py | 10 ++ grid2op/Environment/baseEnv.py | 36 ++++- grid2op/Environment/environment.py | 21 +-- grid2op/Environment/forecast_env.py | 8 +- grid2op/Observation/baseObservation.py | 15 +- grid2op/Observation/observationSpace.py | 1 + grid2op/tests/test_previous_state.py | 34 ++-- 13 files changed, 276 insertions(+), 171 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ff3014f7..eb89c379 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -108,6 +108,8 @@ Native multi agents support: in some docstring) - [FIXED] issues when loading a grid with disconnected elements: grid2op did not know on which bus to reconnect them when only the "reconnect" bus was given. +- [FIXED] an issue leading to wrong setpoint values for shunt_p and shunt_q in the previous + stored state (EnvPreviousState) - [IMPROVED] code for AAA backend tests - [IMPROVED] doc when loading grid with disconnected elements diff --git a/grid2op/Action/_backendAction.py b/grid2op/Action/_backendAction.py index d2479bd0..9ad67936 100644 --- a/grid2op/Action/_backendAction.py +++ b/grid2op/Action/_backendAction.py @@ -943,6 +943,13 @@ def _assign_0_to_disco_el(self) -> None: sto_changed = self.current_topo.changed[cls.storage_pos_topo_vect] sto_bus = self.current_topo.values[cls.storage_pos_topo_vect] self.storage_power.force_unchanged(sto_changed, sto_bus) + + def invalidate_cache(self): + """INTERNAL + + Used when environment is loaded from an observation (eg ForecastEnv) + """ + self._is_cached = False def __call__(self) -> Tuple[np.ndarray, Tuple[ValueStore, ValueStore, ValueStore, ValueStore, ValueStore], diff --git a/grid2op/Action/baseAction.py b/grid2op/Action/baseAction.py index a32c7af5..b2d2d4e4 100644 --- a/grid2op/Action/baseAction.py +++ b/grid2op/Action/baseAction.py @@ -7958,20 +7958,20 @@ def has_element_detached(self): def check_reconnection_valid(self, current_line_status, last_valid_topo_vect): # check lines can be reconnected safely if no bus is provided if not (self._modif_set_status or self._modif_change_status): + # action does not modifies line status, no problem return None + + if (last_valid_topo_vect >= 1).all(): + # all previous buses known, + # no need to check + # TODO speed optimization: if i end up here for one step, then I end up here for all the following + return None + cls = type(self) # line reconnected reco = ((self._set_line_status == 1) | (self._switch_line_status & (~current_line_status))) - - # # line reconnected without topology - # if self._modif_set_bus: - # reco_without_bus = reco.copy() - # reco_without_bus[self._set_topo_vect[cls.line_or_pos_topo_vect] >= 1] = False - # reco_without_bus[self._set_topo_vect[cls.line_ex_pos_topo_vect] >= 1] = False - # else: - # reco_without_bus = reco # check that the "previous bus" is known for these lines vect_or = cls.line_or_pos_topo_vect[reco] @@ -7996,4 +7996,4 @@ def check_reconnection_valid(self, current_line_status, last_valid_topo_vect): f"{cls.name_line[issue_ex.nonzero()[0]]} " f"with id(s) {issue_ex.nonzero()[0]} " f"(extremity side) with no known previous nodes. In this case, you need to specify " - f"explicitly the node / bus to which you want to reconnect it.") \ No newline at end of file + f"explicitly the node / bus to which you want to reconnect it.") diff --git a/grid2op/Backend/backend.py b/grid2op/Backend/backend.py index b2ea26df..98446424 100644 --- a/grid2op/Backend/backend.py +++ b/grid2op/Backend/backend.py @@ -2217,14 +2217,9 @@ def get_action_to_set(self) -> "CompleteAction": } if type(self).shunts_data_available: - p_s, q_s, sh_v, bus_s = self.shunt_info() + p_s, q_s, bus_s = self.get_shunt_setpoint() dict_["shunt"] = {"shunt_bus": bus_s} if (bus_s >= 1).sum(): - sh_conn = bus_s > 0 - p_s[sh_conn] *= (self._sh_vnkv[sh_conn] / sh_v[sh_conn]) ** 2 - q_s[sh_conn] *= (self._sh_vnkv[sh_conn] / sh_v[sh_conn]) ** 2 - p_s[bus_s == -1] = np.nan - q_s[bus_s == -1] = np.nan dict_["shunt"]["shunt_p"] = p_s dict_["shunt"]["shunt_q"] = q_s @@ -2235,6 +2230,23 @@ def get_action_to_set(self) -> "CompleteAction": set_me.update(dict_) return set_me + def get_shunt_setpoint(self): + """INTERNAL + + Is called in "get_action_to_set" but also in "EnvPrevState.update_from_backend" + + This gives the proper input to provide to the shunt (in an action or a backend action) to have + the right outcome. + """ + p_s, q_s, sh_v, bus_s = self.shunt_info() + if (bus_s >= 1).any(): + sh_conn = bus_s > 0 + p_s[sh_conn] *= (self._sh_vnkv[sh_conn] / sh_v[sh_conn]) ** 2 + q_s[sh_conn] *= (self._sh_vnkv[sh_conn] / sh_v[sh_conn]) ** 2 + p_s[bus_s == -1] = np.nan + q_s[bus_s == -1] = np.nan + return p_s, q_s, bus_s + def update_from_obs(self, obs: "grid2op.Observation.CompleteObservation", force_update: Optional[bool]=False) -> "_BackendAction": diff --git a/grid2op/Backend/pandaPowerBackend.py b/grid2op/Backend/pandaPowerBackend.py index 183d8aae..d344b672 100644 --- a/grid2op/Backend/pandaPowerBackend.py +++ b/grid2op/Backend/pandaPowerBackend.py @@ -345,6 +345,7 @@ def reset(self, self._reset_all_nan() self._get_line_status() self._get_topo_vect() + self._fetch_data_pf_converged(is_dc=False) self.comp_time = 0.0 def load_grid(self, @@ -569,8 +570,8 @@ def load_grid(self, # bug in pandapower 3.0.0 in this case del tmp["geo"] pp.create_bus(self._grid, index=ind, **tmp) - self._init_private_attrs() self._aux_run_pf_init() # run yet another powerflow with the added buses + self._init_private_attrs() # do this at the end self._in_service_line_col_id = int((self._grid.line.columns == "in_service").nonzero()[0][0]) @@ -968,14 +969,12 @@ def apply_action(self, backend_action: "grid2op.Action._backendAction._BackendAc chg_and_in_service = sh_service & shunt_bus.changed self._grid.shunt.loc[chg_and_in_service, "bus"] = cls.local_bus_to_global(shunt_bus.values[chg_and_in_service], cls.shunt_to_subid[chg_and_in_service]) - # i made at least a real change, so i implement it in the backend for id_el, new_bus in topo__: id_el_backend, id_topo, type_obj = self._big_topo_to_backend[id_el] if type_obj is not None: # storage unit are handled elsewhere self._type_to_bus_set[type_obj](new_bus, id_el_backend, id_topo) - # self._topo_vect.flags.writeable = True # self._topo_vect[topo__.changed] = topo__.values[topo__.changed] # self._topo_vect.flags.writeable = False @@ -1124,7 +1123,105 @@ def _aux_runpf_pp(self, is_dc: bool): # sometimes pandapower does not detect divergence and put Nan. raise pp.powerflow.LoadflowNotConverged("Divergence due to Nan values in res_gen table (most likely due to " "a non connected grid).") - + + def _fetch_data_pf_converged(self, is_dc): + cls = type(self) + ( + self.prod_p[:], + self.prod_q[:], + self.prod_v[:], + self.gen_theta[:], + ) = self._gens_info() + ( + self.load_p[:], + self.load_q[:], + self.load_v[:], + self.load_theta[:], + ) = self._loads_info() + + if is_dc: + # fix voltages magnitude that are always "nan" for dc case + # self._grid.res_bus["vm_pu"] is always nan when computed in DC + self.load_v[:] = self.load_pu_to_kv # TODO + # need to assign the correct value when a generator is present at the same bus + # TODO optimize this ugly loop + # see https://github.com/e2nIEE/pandapower/issues/1996 for a fix + for l_id in range(cls.n_load): + if cls.load_to_subid[l_id] in cls.gen_to_subid: + ind_gens = ( + cls.gen_to_subid == cls.load_to_subid[l_id] + ).nonzero()[0] + for g_id in ind_gens: + if ( + self._topo_vect[cls.load_pos_topo_vect[l_id]] + == self._topo_vect[cls.gen_pos_topo_vect[g_id]] + ): + self.load_v[l_id] = self.prod_v[g_id] + break + self.load_v[~self._grid.load["in_service"]] = 0. + + # I retrieve the data once for the flows, so has to not re read multiple dataFrame + self.p_or[:] = self._aux_get_line_info("p_from_mw", "p_hv_mw") + self.q_or[:] = self._aux_get_line_info("q_from_mvar", "q_hv_mvar") + self.v_or[:] = self._aux_get_line_info("vm_from_pu", "vm_hv_pu") + self.a_or[:] = self._aux_get_line_info("i_from_ka", "i_hv_ka") * 1000. + self.theta_or[:] = self._aux_get_line_info( + "va_from_degree", "va_hv_degree" + ) + self.a_or[~np.isfinite(self.a_or)] = 0.0 + self.v_or[~np.isfinite(self.v_or)] = 0.0 + + self.p_ex[:] = self._aux_get_line_info("p_to_mw", "p_lv_mw") + self.q_ex[:] = self._aux_get_line_info("q_to_mvar", "q_lv_mvar") + self.v_ex[:] = self._aux_get_line_info("vm_to_pu", "vm_lv_pu") + self.a_ex[:] = self._aux_get_line_info("i_to_ka", "i_lv_ka") * 1000. + self.theta_ex[:] = self._aux_get_line_info( + "va_to_degree", "va_lv_degree" + ) + self.a_ex[~np.isfinite(self.a_ex)] = 0.0 + self.v_ex[~np.isfinite(self.v_ex)] = 0.0 + + # it seems that pandapower does not take into account disconencted powerline for their voltage + self.v_or[~self.line_status] = 0.0 + self.v_ex[~self.line_status] = 0.0 + self.v_or[:] *= self.lines_or_pu_to_kv + self.v_ex[:] *= self.lines_ex_pu_to_kv + + # see issue https://github.com/Grid2Op/grid2op/issues/389 + self.theta_or[~np.isfinite(self.theta_or)] = 0.0 + self.theta_ex[~np.isfinite(self.theta_ex)] = 0.0 + + self._nb_bus_before = None + if self._iref_slack is not None: + # a gen has been added to represent the slack, modeled as an "ext_grid" + self._grid._ppc["gen"][self._iref_slack, 1] = 0.0 + + # handle storage units + # note that we have to look ourselves for disconnected storage + ( + self.storage_p[:], + self.storage_q[:], + self.storage_v[:], + self.storage_theta[:], + ) = self._storages_info() + + deact_storage = ~np.isfinite(self.storage_v) + self.storage_p[deact_storage] = 0.0 + self.storage_q[deact_storage] = 0.0 + self.storage_v[deact_storage] = 0.0 + self._grid.storage["in_service"].values[deact_storage] = False + if not self._grid.converged: + raise pp.powerflow.LoadflowNotConverged("Divergence without specific reason (self._grid.converged is False)") + self.div_exception = None + + if is_dc: + # pandapower apparently does not set 0 for q in DC... + self.prod_q[:] = 0. + self.load_q[:] = 0. + self.storage_q[:] = 0. + self.q_or[:] = 0. + self.q_ex[:] = 0. + def runpf(self, is_dc : bool=False) -> Tuple[bool, Union[Exception, None]]: """ INTERNAL @@ -1151,102 +1248,9 @@ def runpf(self, is_dc : bool=False) -> Tuple[bool, Union[Exception, None]]: buses_ko = self._grid.res_bus.loc[self._grid.bus["in_service"]]["va_degree"].isnull() buses_ko = buses_ko.values.nonzero()[0] raise pp.powerflow.LoadflowNotConverged(f"Isolated bus, check buses {buses_ko} with `env.backend._grid.res_bus.iloc[{buses_ko}, :]`") - - ( - self.prod_p[:], - self.prod_q[:], - self.prod_v[:], - self.gen_theta[:], - ) = self._gens_info() - ( - self.load_p[:], - self.load_q[:], - self.load_v[:], - self.load_theta[:], - ) = self._loads_info() - - if is_dc: - # fix voltages magnitude that are always "nan" for dc case - # self._grid.res_bus["vm_pu"] is always nan when computed in DC - self.load_v[:] = self.load_pu_to_kv # TODO - # need to assign the correct value when a generator is present at the same bus - # TODO optimize this ugly loop - # see https://github.com/e2nIEE/pandapower/issues/1996 for a fix - for l_id in range(cls.n_load): - if cls.load_to_subid[l_id] in cls.gen_to_subid: - ind_gens = ( - cls.gen_to_subid == cls.load_to_subid[l_id] - ).nonzero()[0] - for g_id in ind_gens: - if ( - self._topo_vect[cls.load_pos_topo_vect[l_id]] - == self._topo_vect[cls.gen_pos_topo_vect[g_id]] - ): - self.load_v[l_id] = self.prod_v[g_id] - break - self.load_v[~self._grid.load["in_service"]] = 0. - - # I retrieve the data once for the flows, so has to not re read multiple dataFrame - self.p_or[:] = self._aux_get_line_info("p_from_mw", "p_hv_mw") - self.q_or[:] = self._aux_get_line_info("q_from_mvar", "q_hv_mvar") - self.v_or[:] = self._aux_get_line_info("vm_from_pu", "vm_hv_pu") - self.a_or[:] = self._aux_get_line_info("i_from_ka", "i_hv_ka") * 1000. - self.theta_or[:] = self._aux_get_line_info( - "va_from_degree", "va_hv_degree" - ) - self.a_or[~np.isfinite(self.a_or)] = 0.0 - self.v_or[~np.isfinite(self.v_or)] = 0.0 - - self.p_ex[:] = self._aux_get_line_info("p_to_mw", "p_lv_mw") - self.q_ex[:] = self._aux_get_line_info("q_to_mvar", "q_lv_mvar") - self.v_ex[:] = self._aux_get_line_info("vm_to_pu", "vm_lv_pu") - self.a_ex[:] = self._aux_get_line_info("i_to_ka", "i_lv_ka") * 1000. - self.theta_ex[:] = self._aux_get_line_info( - "va_to_degree", "va_lv_degree" - ) - self.a_ex[~np.isfinite(self.a_ex)] = 0.0 - self.v_ex[~np.isfinite(self.v_ex)] = 0.0 - - # it seems that pandapower does not take into account disconencted powerline for their voltage - self.v_or[~self.line_status] = 0.0 - self.v_ex[~self.line_status] = 0.0 - self.v_or[:] *= self.lines_or_pu_to_kv - self.v_ex[:] *= self.lines_ex_pu_to_kv - - # see issue https://github.com/Grid2Op/grid2op/issues/389 - self.theta_or[~np.isfinite(self.theta_or)] = 0.0 - self.theta_ex[~np.isfinite(self.theta_ex)] = 0.0 - - self._nb_bus_before = None - if self._iref_slack is not None: - # a gen has been added to represent the slack, modeled as an "ext_grid" - self._grid._ppc["gen"][self._iref_slack, 1] = 0.0 - - # handle storage units - # note that we have to look ourselves for disconnected storage - ( - self.storage_p[:], - self.storage_q[:], - self.storage_v[:], - self.storage_theta[:], - ) = self._storages_info() - deact_storage = ~np.isfinite(self.storage_v) - self.storage_p[deact_storage] = 0.0 - self.storage_q[deact_storage] = 0.0 - self.storage_v[deact_storage] = 0.0 - self._grid.storage["in_service"].values[deact_storage] = False - if not self._grid.converged: - raise pp.powerflow.LoadflowNotConverged("Divergence without specific reason (self._grid.converged is False)") - self.div_exception = None + self._fetch_data_pf_converged(is_dc) - if is_dc: - # pandapower apparently does not set 0 for q in DC... - self.prod_q[:] = 0. - self.load_q[:] = 0. - self.storage_q[:] = 0. - self.q_or[:] = 0. - self.q_ex[:] = 0. return True, None except pp.powerflow.LoadflowNotConverged as exc_: diff --git a/grid2op/Environment/_env_prev_state.py b/grid2op/Environment/_env_prev_state.py index 5df868ac..8b07cf3f 100644 --- a/grid2op/Environment/_env_prev_state.py +++ b/grid2op/Environment/_env_prev_state.py @@ -7,7 +7,9 @@ # This file is part of Grid2Op, Grid2Op a testbed platform to model sequential decision making in power systems. import copy -from typing import Optional, Type, Union +from typing import Dict, Literal, Optional, Tuple, Type, Union + +import attr import numpy as np from grid2op.Space import GridObjects import grid2op.Backend @@ -37,20 +39,61 @@ def __init__(self, self._grid_obj_cls : CLS_AS_DICT_TYPING = grid_obj_cls self._n_storage = len(self._grid_obj_cls["name_storage"]) # to avoid typing that over and over again - self._load_p : np.ndarray = 1. * init_load_p - self._load_q : np.ndarray = 1. * init_load_q - self._gen_p : np.ndarray = 1. * init_gen_p - self._gen_v : np.ndarray = 1. * init_gen_v - self._storage_p : np.ndarray = 1. * init_storage_p - self._topo_vect : np.ndarray = 1 * init_topo_vect - self._shunt_p : np.ndarray = 1. * init_shunt_p - self._shunt_q : np.ndarray = 1. * init_shunt_q - self._shunt_bus : np.ndarray = 1. * init_shunt_bus + self._load_p : np.ndarray = init_load_p.copy() + self._load_q : np.ndarray = init_load_q.copy() + self._gen_p : np.ndarray = init_gen_p.copy() + self._gen_v : np.ndarray = init_gen_v.copy() + self._storage_p : np.ndarray = init_storage_p.copy() + self._topo_vect : np.ndarray = init_topo_vect.copy() + self._shunt_p : np.ndarray = init_shunt_p.copy() + self._shunt_q : np.ndarray = init_shunt_q.copy() + self._shunt_bus : np.ndarray = init_shunt_bus.copy() if "detailed_topo_desc" in self._grid_obj_cls and self._grid_obj_cls["detailed_topo_desc"] is not None: - self._switch_state = 1 * init_switch_state + self._switch_state = init_switch_state.copy() else: self._switch_state = None - + + def __eq__(self, value: "_EnvPreviousState"): + return len(self.where_different(value)) == 0 + + def where_different(self, oth: "_EnvPreviousState") -> Dict[ + Literal["_load_p", "_load_q", "_gen_p", "_gen_v", "_storage_p", "_topo_vect", "_shunt_p", "_shunt_q", "_shunt_bus", "_switch_state"], + Tuple[Literal["size", "values", "missing_in_me", "missing_in_other", "me_none", "other_none"], + Optional[np.ndarray], Optional[np.ndarray]] + ]: + """Where this object is different from another one""" + + res = {} + for attr_nm in ["_load_p", "_load_q", "_gen_p", "_gen_v", "_storage_p", "_topo_vect", "_shunt_p", "_shunt_q", "_shunt_bus", "_switch_state"]: + if not hasattr(self, attr_nm) and not hasattr(oth, attr_nm): + # attribute is not present (eg _switch_state when no switch are present) + continue + if not hasattr(self, attr_nm) and hasattr(oth, attr_nm): + res[attr_nm] = ("missing_in_me", None, getattr(oth, attr_nm)) + continue + if hasattr(self, attr_nm) and not hasattr(oth, attr_nm): + res[attr_nm] = ("missing_in_other", getattr(self, attr_nm), None) + continue + arr_me : Optional[np.ndarray] = getattr(self, attr_nm) + arr_oth : Optional[np.ndarray] = getattr(oth, attr_nm) + if arr_me is None and arr_oth is None: + # eg _shunt_p when no shunts + continue + if arr_me is None and arr_oth is not None: + res[attr_nm] = ("me_none", None, arr_oth) + continue + if arr_me is not None and arr_oth is None: + res[attr_nm] = ("other_none", arr_me, None) + continue + if arr_me.shape != arr_oth.shape: + res[attr_nm] = ("size", arr_me.shape, arr_oth.shape) + continue + if np.allclose(arr_me, arr_oth): + # they match + continue + res[attr_nm] = ("values", arr_me.copy(), arr_oth.copy()) + return res + def copy(self): return _EnvPreviousState(grid_obj_cls=self._grid_obj_cls, init_load_p=self._load_p, @@ -127,9 +170,9 @@ def update_from_backend(self, else: storage_p = None if type(backend).shunts_data_available: - shunt_p, shunt_q, _, shunt_bus = backend.shunt_info() + shunt_p, shunt_q, shunt_bus = backend.get_shunt_setpoint() else: - shunt_p, shunt_q, _, shunt_bus = None, None, None, None + shunt_p, shunt_q, shunt_bus = None, None, None switches = None # if type(backend).detailed_topo_desc is not None: diff --git a/grid2op/Environment/_obsEnv.py b/grid2op/Environment/_obsEnv.py index 618580d3..2e9cce54 100644 --- a/grid2op/Environment/_obsEnv.py +++ b/grid2op/Environment/_obsEnv.py @@ -569,3 +569,13 @@ def close(self): if hasattr(self, attr_nm): delattr(self, attr_nm) setattr(self, attr_nm, None) + + def synch_backend_action(self, real_env_backend_action: grid2op.Action._BackendAction) -> None: + """Synchronize the backend action of the (simulated) environment with the backend action of the real environment. + + This is called by the "simulated environment" (forecast env) and allow to remember "past state" of the grid + """ + self._backend_action.last_topo_registered.values[:] = real_env_backend_action.last_topo_registered.values + self._backend_action.current_topo.values[:] = real_env_backend_action.current_topo.values + self._backend_action.invalidate_cache() + self._backend_action.all_changed() diff --git a/grid2op/Environment/baseEnv.py b/grid2op/Environment/baseEnv.py index dd34cd00..825959ce 100644 --- a/grid2op/Environment/baseEnv.py +++ b/grid2op/Environment/baseEnv.py @@ -1513,10 +1513,24 @@ def _has_been_initialized(self): np.zeros(n_shunt, dtype=dt_int), ) + self._compute_init_state() + + def _compute_init_state(self, do_powerflow=True): + """ + INTERNAL + + Usefull to initialize the grid representatino of the env (_backend_action and _previous_conn_state) + to the correct value in the grid. + + It is called when the environment is initialized (first time) but also when the env is reset. + """ if self._init_obs is None: # regular environment, initialized from scratch try: - self.backend.runpf(is_dc=self._parameters.ENV_DC) + if do_powerflow: + conv, exc = self.backend.runpf(is_dc=self._parameters.ENV_DC) + if not conv: + raise exc self._previous_conn_state.update_from_backend(self.backend) except Exception as exc_: # nothing to do in this case @@ -1527,8 +1541,8 @@ def _has_been_initialized(self): # environment initialized from an observation, eg forecast_env # update the backend self._backend_action = self.backend.update_from_obs(self._init_obs) - # self._backend_action.last_topo_registered.values[:] = self._init_obs._prev_conn._topo_vect self._previous_conn_state.update_from_other(self._init_obs._prev_conn) + self._backend_action.current_topo.values[:] = self._init_obs.topo_vect # "fix" topology in case of disconnected element in grid file self._previous_conn_state.fix_topo_bus() @@ -1537,9 +1551,22 @@ def _has_been_initialized(self): # update backend_action with the "last known" state self._backend_action.last_topo_registered.values[:] = self._previous_conn_state._topo_vect - self._backend_action.current_topo.values[:] = self._previous_conn_state._topo_vect self._backend_action._needs_active_bus = self.backend._needs_active_bus + # assign correct topo in case of "no init obs" (not done in the first if self._init_obs is None) + # because I need the fix_topo_bus() + if self._init_obs is None: + self._backend_action.current_topo.values[:] = self._previous_conn_state._topo_vect + + def synch_backend_action(self, real_env_backend_action: _BackendAction) -> None: + """Synchronize the backend action of the (simulated) environment with the backend action of the real environment. + + This is called by the "simulated environment" (forecast env) and allow to remember "past state" of the grid + + This function should be overloaded in the simulated environment + """ + pass + def _update_parameters(self): """update value for the new parameters""" self._parameters = self.__new_param @@ -3226,7 +3253,6 @@ def _aux_apply_redisp(self, except_.append(except_tmp) else: res_action = action - # self._backend_action.set_redispatch(self._actual_dispatch) return res_action, failed_redisp, is_illegal_reco, is_done def _aux_update_backend_action(self, @@ -3836,7 +3862,7 @@ def step(self, action: BaseAction) -> Tuple[BaseObservation, except StopIteration: # episode is over is_done = True - + self._backend_action.reset() end_step = time.perf_counter() self._time_step += end_step - beg_step diff --git a/grid2op/Environment/environment.py b/grid2op/Environment/environment.py index 21b1c0ac..2e0a7c85 100644 --- a/grid2op/Environment/environment.py +++ b/grid2op/Environment/environment.py @@ -503,7 +503,7 @@ def _init_backend( self._observation_space.set_real_env_kwargs(self) # see issue https://github.com/Grid2Op/grid2op/issues/617 - # thermal limits are set AFTER this initial step + # thermal limits are set AFTER this initial "step" _no_overflow_disconnection = self._no_overflow_disconnection self._no_overflow_disconnection = True self._last_obs = None @@ -982,26 +982,17 @@ def reset_grid(self, self.backend.reset_public(self._init_grid_path) self._needs_active_bus = self.backend._needs_active_bus - # self.backend.assert_grid_correct() self._previous_conn_state.update_from_other(self._cst_prev_state_at_init) if self._thermal_limit_a is not None: self.backend.set_thermal_limit(self._thermal_limit_a.astype(dt_float)) self.nb_time_step = -1 # to have init obs at step 1 (and to prevent 'setting to proper state' "action" to be illegal) - - if self._init_obs is not None: - # update the backend from the observation - self._backend_action = self.backend.update_from_obs(self._init_obs) - topo_state_to_use = self._init_obs._prev_conn - else: - self._backend_action = self._backend_action_class() - topo_state_to_use = self._previous_conn_state - # synch the backend action with the init topology - self._backend_action.last_topo_registered.values[:] = topo_state_to_use._topo_vect - self._backend_action.current_topo.values[:] = topo_state_to_use._topo_vect - self._backend_action._needs_active_bus = self._needs_active_bus + # synch the backend action with the init topology + # NB topolgy is supposed to be accessible when the backend is loaded in "reset_public" + # so no need to perform a powerflow in this case. + self._compute_init_state(do_powerflow=False) if self._init_obs is not None: # NB this is called twice (once at the end of reset), this is the first call @@ -1043,7 +1034,7 @@ def reset_grid(self, raise Grid2OpException(f"kwargs `method` used to set the initial state of the grid " f"is not understood (use one of `combine` or `ignore` and " f"not `{method}`)") - + *_, fail_to_start, info = self.step(init_action) if fail_to_start: raise Grid2OpException( diff --git a/grid2op/Environment/forecast_env.py b/grid2op/Environment/forecast_env.py index 9c019cd7..df0821d4 100644 --- a/grid2op/Environment/forecast_env.py +++ b/grid2op/Environment/forecast_env.py @@ -18,11 +18,12 @@ class ForecastEnv(Environment): - """Type of environment that increments the `highres_simulator` when it calls the env.step method. + """ + Type of environment that increments the `highres_simulator` when it calls the env.step method. It is the returned value of :func:`grid2op.Observation.BaseObservation.get_forecast_env`. """ - def __init__(self,**kwargs): + def __init__(self, **kwargs): if "_update_obs_after_reward" not in kwargs: kwargs["_update_obs_after_reward"] = False super().__init__(**kwargs) @@ -33,4 +34,5 @@ def step(self, action: BaseAction) -> Tuple["BaseObservation", bool, STEP_INFO_TYPING]: self._highres_sim_counter += 1 - return super().step(action) + tmp = super().step(action) + return tmp diff --git a/grid2op/Observation/baseObservation.py b/grid2op/Observation/baseObservation.py index 1b75e20d..342b21f9 100644 --- a/grid2op/Observation/baseObservation.py +++ b/grid2op/Observation/baseObservation.py @@ -5060,13 +5060,14 @@ def _make_env_from_arays(self, backend._is_loaded = True nb_highres_called = self._obs_env.highres_sim_counter.nb_highres_called - res = ForecastEnv(**self._ptr_kwargs_env, - backend=backend, - chronics_handler=ch, - parameters=self._obs_env.parameters, - _init_obs=self, - highres_sim_counter=self._obs_env.highres_sim_counter - ) + res = ForecastEnv( + **self._ptr_kwargs_env, + backend=backend, + chronics_handler=ch, + parameters=self._obs_env.parameters, + _init_obs=self, + highres_sim_counter=self._obs_env.highres_sim_counter + ) # it does one simulation when it inits it (calling env.step) so I remove 1 here res.highres_sim_counter._HighResSimCounter__nb_highres_called = nb_highres_called return res diff --git a/grid2op/Observation/observationSpace.py b/grid2op/Observation/observationSpace.py index 976fc11c..a4213fb0 100644 --- a/grid2op/Observation/observationSpace.py +++ b/grid2op/Observation/observationSpace.py @@ -211,6 +211,7 @@ def _create_obs_env(self, env, observationClass): v.initialize(self.obs_env) self.obs_env.backend._disconnected_during_cf = np.full(type(self.obs_env).n_line, fill_value=-1, dtype=dt_int) + self.obs_env.synch_backend_action(env._backend_action) def _aux_create_backend(self, env, observation_bk_class, observation_bk_kwargs, path_grid_for, _local_dir_cls): if observation_bk_kwargs is None: diff --git a/grid2op/tests/test_previous_state.py b/grid2op/tests/test_previous_state.py index 0d95f77a..b4fc5240 100644 --- a/grid2op/tests/test_previous_state.py +++ b/grid2op/tests/test_previous_state.py @@ -275,6 +275,7 @@ def test_line_for_env(self): assert obs.topo_vect[pos_ex_tv] == -1 assert self.env._previous_conn_state._topo_vect[pos_or_tv] == 1 assert self.env._previous_conn_state._topo_vect[pos_ex_tv] == 1 + # reconnect it (forecast env) for_env = obs.get_forecast_env() for_obs = for_env.reset() @@ -298,6 +299,7 @@ def test_line_for_env(self): assert obs.topo_vect[pos_ex_tv] == -1 assert self.env._previous_conn_state._topo_vect[pos_or_tv] == 2 assert self.env._previous_conn_state._topo_vect[pos_ex_tv] == 1 + # reconnect it (forecast env) for_env = obs.get_forecast_env() assert for_env._cst_prev_state_at_init._topo_vect[pos_or_tv] == 2, f"{for_env._cst_prev_state_at_init._topo_vect[pos_or_tv]} vs 2" @@ -364,30 +366,29 @@ def test_cst_prev_state_const(self, env=None): assert env._cst_prev_state_at_init is init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 2 steps") - _ = env.reset() - assert env._cst_prev_state_at_init is init_cst_prev_state + assert env._cst_prev_state_at_init == init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 1 reset") _ = env.step(env.action_space()) - assert env._cst_prev_state_at_init is init_cst_prev_state + assert env._cst_prev_state_at_init == init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 1 reset 1 step") _ = env.step(env.action_space({'set_line_status': [(0, -1)]})) - assert env._cst_prev_state_at_init is init_cst_prev_state + assert env._cst_prev_state_at_init == init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 1 reset 2 steps") _ = env.reset() - assert env._cst_prev_state_at_init is init_cst_prev_state + assert env._cst_prev_state_at_init == init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 2 reset") _ = env.step(env.action_space()) - assert env._cst_prev_state_at_init is init_cst_prev_state + assert env._cst_prev_state_at_init == init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 2 reset 1 step") _ = env.step(env.action_space({'set_line_status': [(0, -1)]})) - assert env._cst_prev_state_at_init is init_cst_prev_state + assert env._cst_prev_state_at_init == init_cst_prev_state assert not env._cst_prev_state_at_init._can_modif self._aux_test_matches_obs(init_cst_prev_state_cpy, env._cst_prev_state_at_init, "after 2 reset 2 steps") @@ -403,23 +404,28 @@ def test_shunt(self, tol=1e-5): obs, reward, done, info = self.env.step(self.env.action_space()) assert obs._shunt_bus[sh_id] == 1 assert np.abs(obs._shunt_p[sh_id] - th_val_p[obs.current_step]) <= tol, f"{obs._shunt_p[sh_id]} vs {th_val_p[obs.current_step]}" - assert np.abs(obs._shunt_q[sh_id] - th_val_q[obs.current_step]) <= tol, f"{obs._shunt_p[sh_id]} vs {th_val_q[obs.current_step]}" + assert np.abs(obs._shunt_q[sh_id] - th_val_q[obs.current_step]) <= tol, f"{obs._shunt_q[sh_id]} vs {th_val_q[obs.current_step]}" self._aux_test_matches_obs(obs, self.env, "after 1 step") # for battery of tests: the bus obs, reward, done, info = self.env.step(self.env.action_space({"shunt": {"set_bus": [(sh_id, -1)]}})) - id_pr_ok = obs.current_step - 1 assert obs._shunt_bus[sh_id] == -1 assert obs._shunt_p[sh_id] == 0. assert obs._shunt_q[sh_id] == 0. assert self.env._previous_conn_state._shunt_bus[sh_id] == 1 - assert np.abs(self.env._previous_conn_state._shunt_p - th_val_p[id_pr_ok]) <= tol, f"{obs._shunt_p[sh_id]} vs {th_val_p[id_pr_ok]}" - assert np.abs(self.env._previous_conn_state._shunt_q - th_val_q[id_pr_ok]) <= tol, f"{obs._shunt_p[sh_id]} vs {th_val_q[id_pr_ok]}" + assert np.abs(self.env._previous_conn_state._shunt_p - 0.) <= tol + assert np.abs(self.env._previous_conn_state._shunt_q - (-19.)) <= tol # setpoint of shunt is -19. and NOT the stuff in obs._shunt_q ! + assert np.abs(obs._prev_conn._shunt_p - 0.) <= tol + assert np.abs(obs._prev_conn._shunt_q - (-19.)) <= tol # setpoint of shunt is -19. and NOT the stuff in obs._shunt_q ! obs, reward, done, info = self.env.step(self.env.action_space({"shunt": {"set_bus": [(sh_id, 1)]}})) assert obs._shunt_bus[sh_id] == 1 assert np.abs(obs._shunt_p[sh_id] - th_val_p[obs.current_step]) <= tol, f"{obs._shunt_p[sh_id]} vs {th_val_p[obs.current_step]}" - assert np.abs(obs._shunt_q[sh_id] - th_val_q[obs.current_step]) <= tol, f"{obs._shunt_p[sh_id]} vs {th_val_q[obs.current_step]}" + assert np.abs(obs._shunt_q[sh_id] - th_val_q[obs.current_step]) <= tol, f"{obs._shunt_q[sh_id]} vs {th_val_q[obs.current_step]}" + assert np.abs(self.env._previous_conn_state._shunt_p - 0.) <= tol + assert np.abs(self.env._previous_conn_state._shunt_q - (-19.)) <= tol # setpoint of shunt is -19. and NOT the stuff in obs._shunt_q ! + assert np.abs(obs._prev_conn._shunt_p - 0.) <= tol + assert np.abs(obs._prev_conn._shunt_q - (-19.)) <= tol # setpoint of shunt is -19. and NOT the stuff in obs._shunt_q ! assert self.env._previous_conn_state._shunt_bus[sh_id] == 1 def test_shunt_simulate(self): @@ -445,8 +451,8 @@ def tearDown(self): def _aux_check_line_disco(self, line_id=2): assert self.env._previous_conn_state._topo_vect[type(self.env).line_or_pos_topo_vect[line_id]] == -1 assert self.env._previous_conn_state._topo_vect[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 - assert self.env._backend_action.current_topo.values[type(self.env).line_or_pos_topo_vect[line_id]] == -1 - assert self.env._backend_action.current_topo.values[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 + assert self.env._backend_action.current_topo.values[type(self.env).line_or_pos_topo_vect[line_id]] == -1, f"{self.env._backend_action.current_topo.values[type(self.env).line_or_pos_topo_vect[line_id]]}" + assert self.env._backend_action.current_topo.values[type(self.env).line_ex_pos_topo_vect[line_id]] == -1, f"{self.env._backend_action.current_topo.values[type(self.env).line_ex_pos_topo_vect[line_id]]}" assert self.env._backend_action.last_topo_registered.values[type(self.env).line_or_pos_topo_vect[line_id]] == -1 assert self.env._backend_action.last_topo_registered.values[type(self.env).line_ex_pos_topo_vect[line_id]] == -1 From b5dbdcd773d9964d5adc4db8af21cc99d51a2da6 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 09:49:22 +0100 Subject: [PATCH 08/16] fix some tests in CI Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 6 ++++-- docs/conf.py | 2 +- grid2op/Backend/backend.py | 7 ++++--- grid2op/Backend/pandaPowerBackend.py | 3 +-- grid2op/Converter/BackendConverter.py | 5 ++++- grid2op/Environment/_env_prev_state.py | 1 - grid2op/__init__.py | 2 +- grid2op/tests/aaa_test_backend_interface.py | 23 +++++++++++++++++++-- 8 files changed, 36 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eb89c379..4694e14a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -100,7 +100,7 @@ Native multi agents support: - add detachment - add change_bus / set_bus -[1.12.3] +[1.12.3] - 2026-02-04 ----------------------- - [FIXED] the warnings when building the documentation. - [FIXED] the deprecation warnings when importing grid2op @@ -110,7 +110,9 @@ Native multi agents support: did not know on which bus to reconnect them when only the "reconnect" bus was given. - [FIXED] an issue leading to wrong setpoint values for shunt_p and shunt_q in the previous stored state (EnvPreviousState) -- [IMPROVED] code for AAA backend tests +- [ADDED] a test (in the AAA test) to assess that the backend._sh_vnkv is properly set if the shunts are + handled by the backend. +- [IMPROVED] code for AAA backend tests (avoid equality check for float) - [IMPROVED] doc when loading grid with disconnected elements [1.12.2] - 2025-11-18 diff --git a/docs/conf.py b/docs/conf.py index e78a0908..4936e0d3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = 'Benjamin Donnot' # The full version, including alpha/beta/rc tags -release = '1.12.3.dev0' +release = '1.12.3' version = '1.12' diff --git a/grid2op/Backend/backend.py b/grid2op/Backend/backend.py index 98446424..e1acbe7b 100644 --- a/grid2op/Backend/backend.py +++ b/grid2op/Backend/backend.py @@ -155,9 +155,10 @@ def __init__(self, # thermal limit setting, in ampere, at the same "side" of the powerline than self.get_line_overflow self.thermal_limit_a : Optional[np.ndarray] = None - # for the shunt (only if supported) - self._sh_vnkv : Optional[np.ndarray]= None # for each shunt gives the nominal value at the bus at which it is connected - # if this information is not present, then "get_action_to_set" might not behave correctly + #: for the shunt (only if supported) + #: for each shunt gives the nominal voltage value at the substation at which it is connected + #: if this information is not present, then "get_action_to_set" might not behave correctly + self._sh_vnkv : Optional[np.ndarray] = None self.comp_time : float = 0.0 self.can_output_theta : bool = False diff --git a/grid2op/Backend/pandaPowerBackend.py b/grid2op/Backend/pandaPowerBackend.py index d344b672..7ab795ec 100644 --- a/grid2op/Backend/pandaPowerBackend.py +++ b/grid2op/Backend/pandaPowerBackend.py @@ -1241,8 +1241,7 @@ def runpf(self, is_dc : bool=False) -> Tuple[bool, Union[Exception, None]]: self._get_line_status() self._get_topo_vect() self._aux_runpf_pp(is_dc) - - cls = type(self) + # if a connected bus has a no voltage, it's a divergence (grid was not connected) if self._grid.res_bus.loc[self._grid.bus["in_service"]]["va_degree"].isnull().any(): buses_ko = self._grid.res_bus.loc[self._grid.bus["in_service"]]["va_degree"].isnull() diff --git a/grid2op/Converter/BackendConverter.py b/grid2op/Converter/BackendConverter.py index cb0ee891..bf6c968c 100644 --- a/grid2op/Converter/BackendConverter.py +++ b/grid2op/Converter/BackendConverter.py @@ -211,7 +211,7 @@ def load_grid(self, path=None, filename=None): ] if type(self.source_backend).shunts_data_available: - li_attrs += ["n_shunt", "name_shunt", "shunts_data_available"] + li_attrs += ["n_shunt", "name_shunt", "shunts_data_available", "_sh_vnkv"] for attr_nm in li_attrs: setattr(self, attr_nm, getattr(self.source_backend, attr_nm)) @@ -354,9 +354,12 @@ def _init_myself(self): sr2tg=self._shunt_sr2tg, nm="shunt", ) + self._sh_vnkv = self.source_backend._sh_vnkv[self._shunt_sr2tg] else: self.n_shunt = 0 self.name_shunt = np.empty(0, dtype=str) + self._sh_vnkv = None + self._thermal_limit_a = 1.0 * self.target_backend.thermal_limit_a self.set_thermal_limit(self.target_backend.thermal_limit_a[self._line_tg2sr]) diff --git a/grid2op/Environment/_env_prev_state.py b/grid2op/Environment/_env_prev_state.py index 8b07cf3f..820626cd 100644 --- a/grid2op/Environment/_env_prev_state.py +++ b/grid2op/Environment/_env_prev_state.py @@ -9,7 +9,6 @@ import copy from typing import Dict, Literal, Optional, Tuple, Type, Union -import attr import numpy as np from grid2op.Space import GridObjects import grid2op.Backend diff --git a/grid2op/__init__.py b/grid2op/__init__.py index c13c4c5d..c75ab596 100644 --- a/grid2op/__init__.py +++ b/grid2op/__init__.py @@ -11,7 +11,7 @@ Grid2Op a testbed platform to model sequential decision making in power systems. """ -__version__ = '1.12.3.dev0' +__version__ = '1.12.3' __all__ = [ "Action", diff --git a/grid2op/tests/aaa_test_backend_interface.py b/grid2op/tests/aaa_test_backend_interface.py index 6e3841ce..30b21671 100644 --- a/grid2op/tests/aaa_test_backend_interface.py +++ b/grid2op/tests/aaa_test_backend_interface.py @@ -1904,5 +1904,24 @@ def test_35_gen_disco_v_zero(self): assert np.abs(gen_p[0]) <= 1e-8, f"disconnected gen should have a p of 0, found {gen_p[0]} (AC)" assert np.abs(gen_q[0]) <= 1e-8, f"disconnected gen should have a q of 0, found {gen_q[0]} (AC)" assert np.abs(gen_v[0]) <= 1e-8, f"disconnected gen should have a voltage set to 0, found {gen_v[0]} (AC)" - - # TODO test: disconnect a gen a load a conso and then connect it again and see what you end up with. \ No newline at end of file + + def test_36_shvnkv_present_if_shunt_supported(self): + """ + .. versionadded: 1.12.3 + + Check that the backend._sh_vnkv is set (not None) if the backend supports shunts. + + It is a requirement from grid2op version 1.12.3 + """ + self.skip_if_needed() + backend = self.aux_make_backend(allow_detachment=True) + cls = type(backend) + if not cls.shunts_data_available: + self.skipTest("This test cannot be performed as your backend does not support shunts") + + sh_vnkv = backend._sh_vnkv + assert sh_vnkv is not None, "If your backend supports shunts, then you need to implement `_sh_vnkv` attribute in the load_grid method of the backend" + assert isinstance(sh_vnkv, np.ndarray), "`_sh_vnkv` attribute should be a numpy array" + assert sh_vnkv.shape[0] == cls.n_shunt, f"_sh_vnkv has len {sh_vnkv.shape[0]} but there are {cls.n_shunt} n shunts on the grid" + + # TODO test: disconnect a gen a load a conso and then connect it again and see what you end up with. From 060cae0e85b17905207354cdbbbe8413075f1b00 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 11:56:19 +0100 Subject: [PATCH 09/16] fix a type hint Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 1 + grid2op/Backend/backend.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4694e14a..cb9f8a2f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -110,6 +110,7 @@ Native multi agents support: did not know on which bus to reconnect them when only the "reconnect" bus was given. - [FIXED] an issue leading to wrong setpoint values for shunt_p and shunt_q in the previous stored state (EnvPreviousState) +- [FIXED] a wrong type hints in `_aux_check_finite_float` of Backend (in Backend.py) - [ADDED] a test (in the AAA test) to assess that the backend._sh_vnkv is properly set if the shunts are handled by the backend. - [IMPROVED] code for AAA backend tests (avoid equality check for float) diff --git a/grid2op/Backend/backend.py b/grid2op/Backend/backend.py index e1acbe7b..2badbeef 100644 --- a/grid2op/Backend/backend.py +++ b/grid2op/Backend/backend.py @@ -2112,7 +2112,7 @@ def load_storage_data(self, f' for {sto_nm} and column "discharging_efficiency"', ) - def _aux_check_finite_float(self, nb_ : float, str_ : Optional[str]="") -> None: + def _aux_check_finite_float(self, nb_ : float, str_ : Optional[str]="") -> dt_float: """ INTERNAL From 469238d968e2f9185a4ff5f74e969938e37e4933 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 12:01:58 +0100 Subject: [PATCH 10/16] add runner tests for version 1.12.3 Signed-off-by: DONNOT Benjamin --- .../res_agent_1.12.3/00/_parameters.json | 26 +++ .../res_agent_1.12.3/00/actions.npz | Bin 0 -> 306 bytes .../res_agent_1.12.3/00/agent_exec_times.npz | Bin 0 -> 229 bytes .../00/disc_lines_cascading_failure.npz | Bin 0 -> 214 bytes .../res_agent_1.12.3/00/env_modifications.npz | Bin 0 -> 406 bytes .../res_agent_1.12.3/00/episode_meta.json | 11 + .../res_agent_1.12.3/00/episode_times.json | 12 + .../res_agent_1.12.3/00/grid2op.info | 3 + .../res_agent_1.12.3/00/observations.npz | Bin 0 -> 1670 bytes .../res_agent_1.12.3/00/opponent_attack.npz | Bin 0 -> 206 bytes .../res_agent_1.12.3/00/other_rewards.json | 6 + .../res_agent_1.12.3/00/rewards.npz | Bin 0 -> 225 bytes .../res_agent_1.12.3/01/_parameters.json | 26 +++ .../res_agent_1.12.3/01/actions.npz | Bin 0 -> 301 bytes .../res_agent_1.12.3/01/agent_exec_times.npz | Bin 0 -> 224 bytes .../01/disc_lines_cascading_failure.npz | Bin 0 -> 214 bytes .../res_agent_1.12.3/01/env_modifications.npz | Bin 0 -> 376 bytes .../res_agent_1.12.3/01/episode_meta.json | 11 + .../res_agent_1.12.3/01/episode_times.json | 12 + .../res_agent_1.12.3/01/grid2op.info | 3 + .../res_agent_1.12.3/01/observations.npz | Bin 0 -> 1353 bytes .../res_agent_1.12.3/01/opponent_attack.npz | Bin 0 -> 206 bytes .../res_agent_1.12.3/01/other_rewards.json | 5 + .../res_agent_1.12.3/01/rewards.npz | Bin 0 -> 221 bytes .../res_agent_1.12.3/dict_action_space.json | 221 ++++++++++++++++++ .../res_agent_1.12.3/dict_attack_space.json | 221 ++++++++++++++++++ .../dict_env_modification_space.json | 221 ++++++++++++++++++ .../dict_observation_space.json | 221 ++++++++++++++++++ grid2op/tests/test_Runner.py | 2 + 29 files changed, 1001 insertions(+) create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/_parameters.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/actions.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/agent_exec_times.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/disc_lines_cascading_failure.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/env_modifications.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/observations.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/opponent_attack.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/other_rewards.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/00/rewards.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/_parameters.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/actions.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/agent_exec_times.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/disc_lines_cascading_failure.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/env_modifications.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/observations.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/opponent_attack.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/other_rewards.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/01/rewards.npz create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/dict_action_space.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/dict_attack_space.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/dict_env_modification_space.json create mode 100644 grid2op/data_test/runner_data/res_agent_1.12.3/dict_observation_space.json diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/_parameters.json b/grid2op/data_test/runner_data/res_agent_1.12.3/00/_parameters.json new file mode 100644 index 00000000..733e6e8a --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/_parameters.json @@ -0,0 +1,26 @@ +{ + "ACTIVATE_STORAGE_LOSS": true, + "ALARM_BEST_TIME": 12, + "ALARM_WINDOW_SIZE": 12, + "ALERT_TIME_WINDOW": 12, + "ALLOW_DISPATCH_GEN_SWITCH_OFF": true, + "ENV_DC": false, + "ENV_DOES_REDISPATCHING": true, + "FORECAST_DC": false, + "HARD_OVERFLOW_THRESHOLD": 2.0, + "IGNORE_INITIAL_STATE_TIME_SERIE": 0, + "IGNORE_MIN_UP_DOWN_TIME": true, + "INIT_STORAGE_CAPACITY": 0.5, + "LIMIT_INFEASIBLE_CURTAILMENT_STORAGE_ACTION": false, + "MAX_LINE_STATUS_CHANGED": 1, + "MAX_SIMULATE_PER_EPISODE": -1, + "MAX_SIMULATE_PER_STEP": -1, + "MAX_SUB_CHANGED": 1, + "NB_TIMESTEP_COOLDOWN_LINE": 0, + "NB_TIMESTEP_COOLDOWN_SUB": 0, + "NB_TIMESTEP_OVERFLOW_ALLOWED": 2, + "NB_TIMESTEP_RECONNECTION": 10, + "NO_OVERFLOW_DISCONNECTION": false, + "SOFT_OVERFLOW_THRESHOLD": 1.0, + "STOP_EP_IF_GEN_BREAK_CONSTRAINTS": false +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/actions.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/actions.npz new file mode 100644 index 0000000000000000000000000000000000000000..a64d0c2883184adb30114194c8728baeb1dc8c76 GIT binary patch literal 306 zcmWIWW@gc4U|`??Vnqf6`J(dwP{6?;!jO_!lBkzgP|3(3z@QKfR00HRAQZ#fi@UR! z97P%)`p#ZHBabI%;e>{khOja(DQ@k^5>?lLo1)T!we5Q*^grX(xm2kc_M`4c!n2UW zbN0vW|7~00IqjrY-{+!`Bj*M7tGzemEi}>=b2XDa*Hu_Ir+m|WBl|O_=jY6mf49|b z@4UADXVFsE9&U@9y!-aHbCbT^d>XUS@BOaj-==<6fBRo=^{(@)%6@KU-+CMBGF0lo t;lr9 zVfrc6#>QsFB{s{7Yb#d@lismF11>j4KcKnZj7+-BsBQt-1+o|9Iv8kR1hHT)3-D%T P1MwMw&9urD$m-&!Pc&xcEMxz>Jc`4-SKwVAx8XSxw!hbZ zEr`!LQW4MpaLv5b=|8Xj$??nMj{FwW{qdLg{p0Q13-3#uZ?F5E{r_IiuVX)gPH$SB zU;A0SYwkYb^DFY}CjVb8{&-*WzbhYVIOJ=)KRe#{e75=h3T=p&ag%@C-v@XzGU+m- ih9x+xfZ+xTT^MKphaW6t1H4(;Kr)O#Xa=Ocz_I|2bC{g~ literal 0 HcmV?d00001 diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json new file mode 100644 index 00000000..d994700b --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json @@ -0,0 +1,11 @@ +{ + "agent_seed": null, + "backend_type": "PandaPowerBackend_rte_case5_examplePandaPowerBackend", + "chronics_max_timestep": "100", + "chronics_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/chronics/00", + "cumulative_reward": 21.61434555053711, + "env_seed": null, + "env_type": "Environment_rte_case5_examplePandaPowerBackend", + "grid_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/grid.json", + "nb_timestep_played": 4 +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json new file mode 100644 index 00000000..c4f52a7d --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json @@ -0,0 +1,12 @@ +{ + "Agent": { + "total": 0.00010556099914538208 + }, + "Env": { + "apply_act": 0.009469127282500267, + "observation_computation": 0.0030375260394066572, + "powerflow_computation": 0.06358130276203156, + "total": 0.07608795911073685 + }, + "total": 0.07775785199919483 +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info b/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info new file mode 100644 index 00000000..7be2930a --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info @@ -0,0 +1,3 @@ +{ + "version": "1.12.0" +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/observations.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/observations.npz new file mode 100644 index 0000000000000000000000000000000000000000..64799781dcc96f634760b6962d15091bbaed8587 GIT binary patch literal 1670 zcmchY=~L1P7{_rneWW=;`{3PppeFkTtFa@ z*_T-lQhCAMfxj^Wtppv7%ZPJLNy|0@S%S{F8GX6=g6UsNAzq4#$h3d-sWiIuack|X z$wY)j4YfX)P*KvAtt&?P3|ddD{3GT15$g3t=UXFDDT14|@ZfXqB5GhzjkCX{(r3rz z@$sCt4AW%CZ4PpDe9L$PR|#zI3J!O^LrdfVG+_@=+0BI-dI(eN5Gl0nSqCSx5xj6q zFxZiR*n8mM(F0Fd{5{zlZqz=1K`Slwmp2Uf?DrhgkImB9Hq}}-ZDPQtT3(NXwdZWW z!446NHqID+cV!fm!LgUa%Ql4W+ZOA?-R9RTy6J~k+XgjQAEtOOlT>dC4fx*cf^D@! z+G#E%qmhv7pB#P770b+;?`V(a_urcgCl0l6?;cKSTI)@!Htc)44k!Gi;CKl!RWkFs zl`^cQYY(`-h{)UG)tNY6q%3xAsj+fbB@@s@a*7%KT@C&a#@!|*ysSrlxf-qu1b7oXlOH78>6 zb$Vsy*1$G+v30mqmwpi<^ecWqXw2hf_OByMXEAlsf*y{~;`V1{#_{`-P{EKqbUvwK z1?y8B;pA4&QPvwjtLUMNi(FDqB56c578Cv7wm?>Y4@065#HVH_>pH#p`hT3j)e9)5$lbj?6g07mK(6w)~ zTIPnv(6!WjQrEB;K!!bPc%nPR4O-T|15#5@} zWX;_eIj2@zKkh65<3!8U}y2B>Nc8AiW`s zc^aU1Sgs!C*S@mP+VU)&bQ@UO=if9Osb$6b`30z0uG4zOnOX0GTZxAyVHT5RZpTB#YNe7$LkV6vA#;%gjr zOUr*cTL9G!xlvqa3(AbZ=xID1{BQub+&^m%bTwZTNoNIKb@f)UoE$Ia50>G0OO((g zQj2aE?p+mo?&T^YWKJC7ic04Q4Lc=6V?NuR>Jtr6dv%$k&iY(;3h#LDc9Pn`B8nuZ^rsKCMuvCqCTJ01?Oy2EgX7u-_FC`>1dW?{ zhI55Hy*YNF-}7;rj4eyoOsQ{im-bkPQLTx}gE*YP%Dr{WwrL0HK5p*1$ICY0WFlT~ zsV>i#i=^{c1|eY~Xk;zShb45Iw~6*;>W5)KGyAg47XxslJiz`$!YsMUy{WI-j!rIA z0&b5M)QlG#`6cX#=JPYz$B*-{)M2ui67ltg|4)2YXjh|PM22?}ZQ%^yY}BhZgu+V1?8{sgdGCvE@$ literal 0 HcmV?d00001 diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/opponent_attack.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/opponent_attack.npz new file mode 100644 index 0000000000000000000000000000000000000000..43189fedfc581d3b2697399e9de3d5e6216a3f78 GIT binary patch literal 206 zcmWIWW@gc4U|`??Vnv4fx;U@@P{6?;!jO_!lBkzgP|3(3z|a6x0RkQniedH}@mJCU zCr<<%3s^gEQq-K7C3#C1c9_Zdw;)-LgM6|p5u zKc(8(*sQqNW?6A<ilm#Q*>R literal 0 HcmV?d00001 diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/agent_exec_times.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/01/agent_exec_times.npz new file mode 100644 index 0000000000000000000000000000000000000000..fb40f452153ca4708446e64e2161e3a6d036574c GIT binary patch literal 224 zcmWIWW@gc4U|`??Vnqg~r^zb+p@4%ygdrudBvCJ~ppub6fI)x>s00Y2AQZ#wH{!3P z1x}s_I2N#W-lV8GF-!86F36jlwrJhr1@orGhXhTTAwEBT$|NqKa_=*meym;M=_+DN zn0`vNv9Vdrvf|pxmBOqi$>`QS(~$oRcjdKN#s)Gglr9 zVfrc6#>QsFB{s{7Yb#d@lismF11>j4KcKnZj7+-BsBQt-1+o|9Iv8kR1hHT)3-D%T P1MwMw&ZzPez@~CD1PepCMdE(aFt8Qg8&rUxok*t1fc^(IU_*RMOyDy(~7d(_L_}F_^ z`O%7!*~|XuUH`sy*ZnK6%lBVC8C2Dt*OUM2Z*baQwYeW(d_4ZQ&;7k??f$jbiWlCm z{CxHOnsBJ6a8eEbzi|e5GcxHiqlOkZG=L!k3O^WVU<9#XVHe=d$_C;y0-+g@)&a`` E0R8)jVgLXD literal 0 HcmV?d00001 diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json new file mode 100644 index 00000000..ee6705ac --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json @@ -0,0 +1,11 @@ +{ + "agent_seed": null, + "backend_type": "PandaPowerBackend_rte_case5_examplePandaPowerBackend", + "chronics_max_timestep": "100", + "chronics_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/chronics/01", + "cumulative_reward": 11.967159271240234, + "env_seed": null, + "env_type": "Environment_rte_case5_examplePandaPowerBackend", + "grid_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/grid.json", + "nb_timestep_played": 3 +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json new file mode 100644 index 00000000..d193ede0 --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json @@ -0,0 +1,12 @@ +{ + "Agent": { + "total": 7.814600030542351e-05 + }, + "Env": { + "apply_act": 0.007293818984180689, + "observation_computation": 0.002276361919939518, + "powerflow_computation": 0.0539729930460453, + "total": 0.0635431781411171 + }, + "total": 0.06488691300000937 +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info b/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info new file mode 100644 index 00000000..7be2930a --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info @@ -0,0 +1,3 @@ +{ + "version": "1.12.0" +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/observations.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/01/observations.npz new file mode 100644 index 0000000000000000000000000000000000000000..6b7f9780cfd59cc7a56557262f0b43cb327ee292 GIT binary patch literal 1353 zcmcK4=~EI26aa8cYilwqHAyqvF2liN)529eW|tB-^GM1Rml(yP1f?)Q1hl3pwen~Y z4Z}3lTrDz(2tf(6V?9DEMbju-osvT+r91**wYCrY2kd+E-uv+0hxh3h6=rGW0RRA2 zF4h)6NGiS5{BNuT*aMOhP9=C|oS<3&)&Wj?SuEZF01vIc4uE!W&4I(o&VNnS^v3mm zBqg2BCJ8jF{X5GGo&-(=AY`%wt1e#lNa~g^&*vU1bNw;QIyM4g(SKrxo|l-cB4+hT z&=@bFJH4UMF(NS*N~(xKk*jEw_LMHMJVs*}4Wjf>b<}HShAsyN)3`9`>Q4hU-L~(j z2F|5@{7mgQekPAoGuaGn_1Q@|neoMVm!t4=B<4hC4{|TH8@W`~YVT!3XUE6Ku<28) z*4h*Zcz4bnMzi94UBUbBH-c~6xLelXR~aEtDcmG&BPj!sn?E&k2MS6+VyQ0Vt>Gpr z`SIoU3MUyx7{(l}44AYFOrvkT_tS{B(iuDWp{1n7mnMSNonq&BzN-68!Y@0XLtu4Y z(z&Jekd?S52X$c{lxE9>itEaOO+?}6G~@!yD|AK)o5OAE3YLQ-B-_s)(gKS#;ZI~1 zvR_BoI$H<`R72o7@no;>c%Gb4)}=Ht<8 zA=A~|wA33Kb=Gin`Fm0*kgG$&&9jwvk7#*o5kIp&i21=syfZ05^>Y27zjG&o<%%fW zQ{hm-S55Qh&K96r!wEf71*Fv6riN#aeXL2mGHzGQg4g?Oy^_06w6SHP+EtH8D8|DPgRi>#lAC#S$FWbPjn* zd|vpdBu+?FFu!__nHY(q&%iMylg$KG$~L#&j5&hm`Y+Z^R|4+5%u-*)Zz=Q>As$5< zetE@WYWLrFzFu5lP;l7dk%cEC`PC|~rxe*#pFYV(qolU(i0)}MHX0^M*N@e2+E-z3 z$Ku8>+|tKlHQC8{!Qbv6oV()c_7#CALw0YlceDeA+C`I*qCdlwTrzlry5oXn(ZRqk z4bOd0&cl`UR-2W>2EtP*cfmAg{v+3KsLUKY;oz~`r8^g!_dr{vxo7MVTsQibIX{Qs zG>>NQV|nwlLnJ0mGd-V+Gga;^x)3-Y^!(<)PBI3+o7ULWaEA6;@KE~f_F-vl6|IgI zB>^84B5quqnpyq8=!6Z6aD0tW zrn8A0O5x>U>Y0*zq=isCIv2g^koMG?a1mm**FQlQ4k6QCh=1S}xf2C#Y?U9nze^vJ zS?jywIt9LsM+~MGTkWV)!cFGtjw};S_&(Sid(NT4<{f4j0}3$# zl~M+fYhuWc>N=((jYU#=FL~N)lrl2ya+D4E2Fy2J{_k$;$ypv1X0gn}^1u8o@wPc9_Zdw;)-LgM6|p5u zKc(8(*sQqNW?6A<lr9 zVfrc6#>Qqf%Zh6&R|@mGy|>t9a{AsEConWKe_dRWV8{^Q&B&z7jOrwil_2Xuj)Z{* YMi2|;zyNPnHV~f?2+e@>L=cAo06Ez`iU0rr literal 0 HcmV?d00001 diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/dict_action_space.json b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_action_space.json new file mode 100644 index 00000000..a337920d --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_action_space.json @@ -0,0 +1,221 @@ +{ + "_PATH_GRID_CLASSES": null, + "_init_subtype": "grid2op.Action.topologyAction.TopologyAction", + "alarms_area_lines": [], + "alarms_area_names": [], + "alarms_lines_area": {}, + "alertable_line_ids": [], + "alertable_line_names": [], + "assistant_warning_type": null, + "detachment_is_allowed": "False", + "dim_alarms": 0, + "dim_alerts": 0, + "env_name": "rte_case5_examplePandaPowerBackend", + "gen_cost_per_MW": [ + 0.0, + 70.0 + ], + "gen_max_ramp_down": [ + 0.0, + 10.0 + ], + "gen_max_ramp_up": [ + 0.0, + 10.0 + ], + "gen_min_downtime": [ + 0, + 4 + ], + "gen_min_uptime": [ + 0, + 4 + ], + "gen_pmax": [ + 10.0, + 30.0 + ], + "gen_pmin": [ + 0.0, + 0.0 + ], + "gen_pos_topo_vect": [ + 4, + 8 + ], + "gen_redispatchable": [ + false, + true + ], + "gen_renewable": [ + true, + false + ], + "gen_shutdown_cost": [ + 0.0, + 1.0 + ], + "gen_startup_cost": [ + 0.0, + 2.0 + ], + "gen_to_sub_pos": [ + 4, + 2 + ], + "gen_to_subid": [ + 0, + 1 + ], + "gen_type": [ + "wind", + "thermal" + ], + "glop_version": "1.12.0", + "grid_layout": { + "sub_0": [ + 0.0, + 0.0 + ], + "sub_1": [ + 0.0, + 400.0 + ], + "sub_2": [ + 200.0, + 400.0 + ], + "sub_3": [ + 400.0, + 400.0 + ], + "sub_4": [ + 400.0, + 0.0 + ] + }, + "line_ex_pos_topo_vect": [ + 6, + 9, + 13, + 18, + 10, + 14, + 15, + 19 + ], + "line_ex_to_sub_pos": [ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1 + ], + "line_ex_to_subid": [ + 1, + 2, + 3, + 4, + 2, + 3, + 3, + 4 + ], + "line_or_pos_topo_vect": [ + 0, + 1, + 2, + 3, + 7, + 11, + 12, + 16 + ], + "line_or_to_sub_pos": [ + 0, + 1, + 2, + 3, + 1, + 2, + 3, + 3 + ], + "line_or_to_subid": [ + 0, + 0, + 0, + 0, + 1, + 2, + 2, + 3 + ], + "load_pos_topo_vect": [ + 5, + 17, + 20 + ], + "load_to_sub_pos": [ + 5, + 4, + 2 + ], + "load_to_subid": [ + 0, + 3, + 4 + ], + "n_busbar_per_sub": "2", + "name_gen": [ + "gen_0_0", + "gen_1_1" + ], + "name_line": [ + "0_1_0", + "0_2_1", + "0_3_2", + "0_4_3", + "1_2_4", + "2_3_5", + "2_3_6", + "3_4_7" + ], + "name_load": [ + "load_0_0", + "load_3_1", + "load_4_2" + ], + "name_shunt": [], + "name_storage": [], + "name_sub": [ + "sub_0", + "sub_1", + "sub_2", + "sub_3", + "sub_4" + ], + "shunt_to_subid": [], + "storage_Emax": [], + "storage_Emin": [], + "storage_charging_efficiency": [], + "storage_discharging_efficiency": [], + "storage_loss": [], + "storage_marginal_cost": [], + "storage_max_p_absorb": [], + "storage_max_p_prod": [], + "storage_pos_topo_vect": [], + "storage_to_sub_pos": [], + "storage_to_subid": [], + "storage_type": [], + "sub_info": [ + 6, + 3, + 4, + 5, + 3 + ] +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/dict_attack_space.json b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_attack_space.json new file mode 100644 index 00000000..3bd04320 --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_attack_space.json @@ -0,0 +1,221 @@ +{ + "_PATH_GRID_CLASSES": null, + "_init_subtype": "grid2op.Action.dontAct.DontAct", + "alarms_area_lines": [], + "alarms_area_names": [], + "alarms_lines_area": {}, + "alertable_line_ids": [], + "alertable_line_names": [], + "assistant_warning_type": null, + "detachment_is_allowed": "False", + "dim_alarms": 0, + "dim_alerts": 0, + "env_name": "rte_case5_examplePandaPowerBackend", + "gen_cost_per_MW": [ + 0.0, + 70.0 + ], + "gen_max_ramp_down": [ + 0.0, + 10.0 + ], + "gen_max_ramp_up": [ + 0.0, + 10.0 + ], + "gen_min_downtime": [ + 0, + 4 + ], + "gen_min_uptime": [ + 0, + 4 + ], + "gen_pmax": [ + 10.0, + 30.0 + ], + "gen_pmin": [ + 0.0, + 0.0 + ], + "gen_pos_topo_vect": [ + 4, + 8 + ], + "gen_redispatchable": [ + false, + true + ], + "gen_renewable": [ + true, + false + ], + "gen_shutdown_cost": [ + 0.0, + 1.0 + ], + "gen_startup_cost": [ + 0.0, + 2.0 + ], + "gen_to_sub_pos": [ + 4, + 2 + ], + "gen_to_subid": [ + 0, + 1 + ], + "gen_type": [ + "wind", + "thermal" + ], + "glop_version": "1.12.0", + "grid_layout": { + "sub_0": [ + 0.0, + 0.0 + ], + "sub_1": [ + 0.0, + 400.0 + ], + "sub_2": [ + 200.0, + 400.0 + ], + "sub_3": [ + 400.0, + 400.0 + ], + "sub_4": [ + 400.0, + 0.0 + ] + }, + "line_ex_pos_topo_vect": [ + 6, + 9, + 13, + 18, + 10, + 14, + 15, + 19 + ], + "line_ex_to_sub_pos": [ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1 + ], + "line_ex_to_subid": [ + 1, + 2, + 3, + 4, + 2, + 3, + 3, + 4 + ], + "line_or_pos_topo_vect": [ + 0, + 1, + 2, + 3, + 7, + 11, + 12, + 16 + ], + "line_or_to_sub_pos": [ + 0, + 1, + 2, + 3, + 1, + 2, + 3, + 3 + ], + "line_or_to_subid": [ + 0, + 0, + 0, + 0, + 1, + 2, + 2, + 3 + ], + "load_pos_topo_vect": [ + 5, + 17, + 20 + ], + "load_to_sub_pos": [ + 5, + 4, + 2 + ], + "load_to_subid": [ + 0, + 3, + 4 + ], + "n_busbar_per_sub": "2", + "name_gen": [ + "gen_0_0", + "gen_1_1" + ], + "name_line": [ + "0_1_0", + "0_2_1", + "0_3_2", + "0_4_3", + "1_2_4", + "2_3_5", + "2_3_6", + "3_4_7" + ], + "name_load": [ + "load_0_0", + "load_3_1", + "load_4_2" + ], + "name_shunt": [], + "name_storage": [], + "name_sub": [ + "sub_0", + "sub_1", + "sub_2", + "sub_3", + "sub_4" + ], + "shunt_to_subid": [], + "storage_Emax": [], + "storage_Emin": [], + "storage_charging_efficiency": [], + "storage_discharging_efficiency": [], + "storage_loss": [], + "storage_marginal_cost": [], + "storage_max_p_absorb": [], + "storage_max_p_prod": [], + "storage_pos_topo_vect": [], + "storage_to_sub_pos": [], + "storage_to_subid": [], + "storage_type": [], + "sub_info": [ + 6, + 3, + 4, + 5, + 3 + ] +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/dict_env_modification_space.json b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_env_modification_space.json new file mode 100644 index 00000000..128c2a86 --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_env_modification_space.json @@ -0,0 +1,221 @@ +{ + "_PATH_GRID_CLASSES": null, + "_init_subtype": "grid2op.Action.completeAction.CompleteAction", + "alarms_area_lines": [], + "alarms_area_names": [], + "alarms_lines_area": {}, + "alertable_line_ids": [], + "alertable_line_names": [], + "assistant_warning_type": null, + "detachment_is_allowed": "False", + "dim_alarms": 0, + "dim_alerts": 0, + "env_name": "rte_case5_examplePandaPowerBackend", + "gen_cost_per_MW": [ + 0.0, + 70.0 + ], + "gen_max_ramp_down": [ + 0.0, + 10.0 + ], + "gen_max_ramp_up": [ + 0.0, + 10.0 + ], + "gen_min_downtime": [ + 0, + 4 + ], + "gen_min_uptime": [ + 0, + 4 + ], + "gen_pmax": [ + 10.0, + 30.0 + ], + "gen_pmin": [ + 0.0, + 0.0 + ], + "gen_pos_topo_vect": [ + 4, + 8 + ], + "gen_redispatchable": [ + false, + true + ], + "gen_renewable": [ + true, + false + ], + "gen_shutdown_cost": [ + 0.0, + 1.0 + ], + "gen_startup_cost": [ + 0.0, + 2.0 + ], + "gen_to_sub_pos": [ + 4, + 2 + ], + "gen_to_subid": [ + 0, + 1 + ], + "gen_type": [ + "wind", + "thermal" + ], + "glop_version": "1.12.0", + "grid_layout": { + "sub_0": [ + 0.0, + 0.0 + ], + "sub_1": [ + 0.0, + 400.0 + ], + "sub_2": [ + 200.0, + 400.0 + ], + "sub_3": [ + 400.0, + 400.0 + ], + "sub_4": [ + 400.0, + 0.0 + ] + }, + "line_ex_pos_topo_vect": [ + 6, + 9, + 13, + 18, + 10, + 14, + 15, + 19 + ], + "line_ex_to_sub_pos": [ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1 + ], + "line_ex_to_subid": [ + 1, + 2, + 3, + 4, + 2, + 3, + 3, + 4 + ], + "line_or_pos_topo_vect": [ + 0, + 1, + 2, + 3, + 7, + 11, + 12, + 16 + ], + "line_or_to_sub_pos": [ + 0, + 1, + 2, + 3, + 1, + 2, + 3, + 3 + ], + "line_or_to_subid": [ + 0, + 0, + 0, + 0, + 1, + 2, + 2, + 3 + ], + "load_pos_topo_vect": [ + 5, + 17, + 20 + ], + "load_to_sub_pos": [ + 5, + 4, + 2 + ], + "load_to_subid": [ + 0, + 3, + 4 + ], + "n_busbar_per_sub": "2", + "name_gen": [ + "gen_0_0", + "gen_1_1" + ], + "name_line": [ + "0_1_0", + "0_2_1", + "0_3_2", + "0_4_3", + "1_2_4", + "2_3_5", + "2_3_6", + "3_4_7" + ], + "name_load": [ + "load_0_0", + "load_3_1", + "load_4_2" + ], + "name_shunt": [], + "name_storage": [], + "name_sub": [ + "sub_0", + "sub_1", + "sub_2", + "sub_3", + "sub_4" + ], + "shunt_to_subid": [], + "storage_Emax": [], + "storage_Emin": [], + "storage_charging_efficiency": [], + "storage_discharging_efficiency": [], + "storage_loss": [], + "storage_marginal_cost": [], + "storage_max_p_absorb": [], + "storage_max_p_prod": [], + "storage_pos_topo_vect": [], + "storage_to_sub_pos": [], + "storage_to_subid": [], + "storage_type": [], + "sub_info": [ + 6, + 3, + 4, + 5, + 3 + ] +} \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/dict_observation_space.json b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_observation_space.json new file mode 100644 index 00000000..3fe1883a --- /dev/null +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/dict_observation_space.json @@ -0,0 +1,221 @@ +{ + "_PATH_GRID_CLASSES": null, + "_init_subtype": "grid2op.Observation.completeObservation.CompleteObservation", + "alarms_area_lines": [], + "alarms_area_names": [], + "alarms_lines_area": {}, + "alertable_line_ids": [], + "alertable_line_names": [], + "assistant_warning_type": null, + "detachment_is_allowed": "False", + "dim_alarms": 0, + "dim_alerts": 0, + "env_name": "rte_case5_examplePandaPowerBackend", + "gen_cost_per_MW": [ + 0.0, + 70.0 + ], + "gen_max_ramp_down": [ + 0.0, + 10.0 + ], + "gen_max_ramp_up": [ + 0.0, + 10.0 + ], + "gen_min_downtime": [ + 0, + 4 + ], + "gen_min_uptime": [ + 0, + 4 + ], + "gen_pmax": [ + 10.0, + 30.0 + ], + "gen_pmin": [ + 0.0, + 0.0 + ], + "gen_pos_topo_vect": [ + 4, + 8 + ], + "gen_redispatchable": [ + false, + true + ], + "gen_renewable": [ + true, + false + ], + "gen_shutdown_cost": [ + 0.0, + 1.0 + ], + "gen_startup_cost": [ + 0.0, + 2.0 + ], + "gen_to_sub_pos": [ + 4, + 2 + ], + "gen_to_subid": [ + 0, + 1 + ], + "gen_type": [ + "wind", + "thermal" + ], + "glop_version": "1.12.0", + "grid_layout": { + "sub_0": [ + 0.0, + 0.0 + ], + "sub_1": [ + 0.0, + 400.0 + ], + "sub_2": [ + 200.0, + 400.0 + ], + "sub_3": [ + 400.0, + 400.0 + ], + "sub_4": [ + 400.0, + 0.0 + ] + }, + "line_ex_pos_topo_vect": [ + 6, + 9, + 13, + 18, + 10, + 14, + 15, + 19 + ], + "line_ex_to_sub_pos": [ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1 + ], + "line_ex_to_subid": [ + 1, + 2, + 3, + 4, + 2, + 3, + 3, + 4 + ], + "line_or_pos_topo_vect": [ + 0, + 1, + 2, + 3, + 7, + 11, + 12, + 16 + ], + "line_or_to_sub_pos": [ + 0, + 1, + 2, + 3, + 1, + 2, + 3, + 3 + ], + "line_or_to_subid": [ + 0, + 0, + 0, + 0, + 1, + 2, + 2, + 3 + ], + "load_pos_topo_vect": [ + 5, + 17, + 20 + ], + "load_to_sub_pos": [ + 5, + 4, + 2 + ], + "load_to_subid": [ + 0, + 3, + 4 + ], + "n_busbar_per_sub": "2", + "name_gen": [ + "gen_0_0", + "gen_1_1" + ], + "name_line": [ + "0_1_0", + "0_2_1", + "0_3_2", + "0_4_3", + "1_2_4", + "2_3_5", + "2_3_6", + "3_4_7" + ], + "name_load": [ + "load_0_0", + "load_3_1", + "load_4_2" + ], + "name_shunt": [], + "name_storage": [], + "name_sub": [ + "sub_0", + "sub_1", + "sub_2", + "sub_3", + "sub_4" + ], + "shunt_to_subid": [], + "storage_Emax": [], + "storage_Emin": [], + "storage_charging_efficiency": [], + "storage_discharging_efficiency": [], + "storage_loss": [], + "storage_marginal_cost": [], + "storage_max_p_absorb": [], + "storage_max_p_prod": [], + "storage_pos_topo_vect": [], + "storage_to_sub_pos": [], + "storage_to_subid": [], + "storage_type": [], + "sub_info": [ + 6, + 3, + 4, + 5, + 3 + ] +} \ No newline at end of file diff --git a/grid2op/tests/test_Runner.py b/grid2op/tests/test_Runner.py index 28828a8b..9688a29c 100644 --- a/grid2op/tests/test_Runner.py +++ b/grid2op/tests/test_Runner.py @@ -526,6 +526,8 @@ def test_backward_compatibility(self): "1.11.0", "1.12.0", "1.12.1", + "1.12.2", + "1.12.3", ] curr_version = "test_version" assert ( From b59af4c8b7b9793b92559e5fd08988d2eaf6ecf2 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 13:57:11 +0100 Subject: [PATCH 11/16] fixing generated data for the runner for 1.12.3 Signed-off-by: DONNOT Benjamin --- .../res_agent_1.12.3/00/actions.npz | Bin 306 -> 305 bytes .../res_agent_1.12.3/00/agent_exec_times.npz | Bin 229 -> 229 bytes .../00/disc_lines_cascading_failure.npz | Bin 214 -> 218 bytes .../res_agent_1.12.3/00/episode_meta.json | 2 +- .../res_agent_1.12.3/00/episode_times.json | 12 ++++++------ .../res_agent_1.12.3/00/grid2op.info | 2 +- .../res_agent_1.12.3/00/observations.npz | Bin 1670 -> 1768 bytes .../res_agent_1.12.3/00/rewards.npz | Bin 225 -> 225 bytes .../res_agent_1.12.3/01/actions.npz | Bin 301 -> 284 bytes .../res_agent_1.12.3/01/agent_exec_times.npz | Bin 224 -> 220 bytes .../01/disc_lines_cascading_failure.npz | Bin 214 -> 217 bytes .../res_agent_1.12.3/01/env_modifications.npz | Bin 376 -> 350 bytes .../res_agent_1.12.3/01/episode_meta.json | 4 ++-- .../res_agent_1.12.3/01/episode_times.json | 12 ++++++------ .../res_agent_1.12.3/01/grid2op.info | 2 +- .../res_agent_1.12.3/01/observations.npz | Bin 1353 -> 1077 bytes .../res_agent_1.12.3/01/other_rewards.json | 1 - .../res_agent_1.12.3/01/rewards.npz | Bin 221 -> 217 bytes grid2op/tests/test_Runner.py | 10 ++++++---- 19 files changed, 23 insertions(+), 22 deletions(-) diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/actions.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/actions.npz index a64d0c2883184adb30114194c8728baeb1dc8c76..f9916863ca357ca2d9ce5c493392054fa10b18c8 100644 GIT binary patch literal 305 zcmWIWW@gc4U|`??Vnqf&r^9RhLjeba2t!I@Nupj}K_w%D0E0p_PzeyMhENP|FWF`> zIZ8A<-1=4Ia_=EAHW3w;NvF;wBv163wj)W<^o8xy=)oYnz#t zurG4&x7~ZUdl`8@E1WU?y=x86$IL4|nH`HWKZd4EKDb5V+5YEq-z+|3{`{%M?=$AV zZ#gfX*cP^XUYo1M+N`39`{sY2H2w6QpYgZ$ojh3emM^{3WV?0tck%zbHr7ppx(t;n s$jc7!W@OT3M)fAh8z3)%JPrd5j35@w(*fSBY#=@(5Sjt$ryvdk0NY<^0RR91 literal 306 zcmWIWW@gc4U|`??Vnqf6`J(dwP{6?;!jO_!lBkzgP|3(3z@QKfR00HRAQZ#fi@UR! z97P%)`p#ZHBabI%;e>{khOja(DQ@k^5>?lLo1)T!we5Q*^grX(xm2kc_M`4c!n2UW zbN0vW|7~00IqjrY-{+!`Bj*M7tGzemEi}>=b2XDa*Hu_Ir+m|WBl|O_=jY6mf49|b z@4UADXVFsE9&U@9y!-aHbCbT^d>XUS@BOaj-==<6fBRo=^{(@)%6@KU-+CMBGF0lo t;@s7z?+#xmw|zS1BewF_CA07X`)cBUU&c8XZ~f;GxRs`8_rjHk#p`q!Gbyw Sei=4~0B=SnU1l^LYb^ku#TbhK delta 76 zcmaFL_>@s7z?+#xmw|zS1BewFD$IQ1Cko~2wHNqu?_T2jtp1n&%=uLo*XJ}oboi?w SXTie|;LXUS%Z#RDtpxx;mKAUS diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/disc_lines_cascading_failure.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/disc_lines_cascading_failure.npz index 43d425133bd5ea96b6ab4eeecf6921c8f3bf9aa4..1e155fc334a720470f894efa661054e441768252 100644 GIT binary patch delta 104 zcmcb{c#F|Ez?+#xmw|zS1BewF)?fb~_#X;57(^IS5=#>G@(L;$83Y&>FawnULC8d7 kKP9)A2FB%QG$dG+*%%lCycwBvnNdv%nK<8&tq-gL0E{*qS^xk5 delta 100 zcmcb`c#Y9Gz?+#xmw|zS1BewFR+!&*{SO5k3?d9Ei6x18c?Fe>3<3-bn1M=wAYh`g epWLxP11>j4KOoPWkx7>s)r5eFiw)Vjz={FEQ5li| diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json index d994700b..c5f02c09 100644 --- a/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_meta.json @@ -3,7 +3,7 @@ "backend_type": "PandaPowerBackend_rte_case5_examplePandaPowerBackend", "chronics_max_timestep": "100", "chronics_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/chronics/00", - "cumulative_reward": 21.61434555053711, + "cumulative_reward": 14.923386573791504, "env_seed": null, "env_type": "Environment_rte_case5_examplePandaPowerBackend", "grid_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/grid.json", diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json index c4f52a7d..d3d46862 100644 --- a/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/episode_times.json @@ -1,12 +1,12 @@ { "Agent": { - "total": 0.00010556099914538208 + "total": 5.173299723537639e-05 }, "Env": { - "apply_act": 0.009469127282500267, - "observation_computation": 0.0030375260394066572, - "powerflow_computation": 0.06358130276203156, - "total": 0.07608795911073685 + "apply_act": 0.005063856951892376, + "observation_computation": 0.0016567599959671497, + "powerflow_computation": 0.06105741858482361, + "total": 0.06777803599834442 }, - "total": 0.07775785199919483 + "total": 0.06871504700029618 } \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info b/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info index 7be2930a..47d0a3b4 100644 --- a/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/00/grid2op.info @@ -1,3 +1,3 @@ { - "version": "1.12.0" + "version": "1.12.3" } \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/observations.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/observations.npz index 64799781dcc96f634760b6962d15091bbaed8587..9ad5e6eeb28875c20a5e4f010cf2df6874b87105 100644 GIT binary patch delta 1644 zcmV-y29x=Q4d@MjP)h>@EdT%j2mk;8Apn#}him`;|NsC0|NjU86aZvlbYU)TaCrd$ z5CDKL0RR91003eJ00000008aR3s4o;9mnyDkJLacZBtWILxNPiNTCWOBNAcHo?~Rv zj*)1LQgi|u5R3|f4~#aVZ6Jn%twa&DQ%cbIN|ZQ~3<~UjUXroR1&NlCfKuC{=2hET zO(rJ9_AbmCQW7vUooPDX|IBB0&)L2E=UjesW^d60v!=zxdpTA*);J$c&RUS^jPiF* zPPy9|;_pmJ&s?6FwDghm%tw>0`Kd{ZvywgYS*b}G$)0gg*o3eU|FB8n<3jv@;y5|wj_YNJ#)bxMXV6JKOO8?{HFwlI91YUa*l>&PxuHu$M7@ZJI3!Y1 zs)TjTIOdjfpLfecJ8m;8!@prPg*_D$m6j|1Ub9?3ez8_qvg_7}tibJZ=uNjswW~s3 z^zk}<6Uaz(w_+_J@dvvR8( zl=!r6S+O=wxBJ=avCr-C*fZx;+#hGFl4ahiYI&=Ce@3gy32Ty;SI3sh=9eaG5BV(A zwx&jZX=jg*(5eni)>h1~iLtcA-l}zf-+k$?`uqGq45V`E`u4@j%3R;;w0rif-+J;< zCakkJs+WrHIe#mkj$iEij_9{(ul!rjGDK-ftM;Q0Pv~V|^H-}jkG`J&hzK9OwB)Mi zx>r~J9gc(7^Z$byx6FCYEwB9iPV?hs$~d%ttx&5D*)9TCr|HQVfx6d@K_N?mXN#8D z3Yp(FN@m|&q!*4^sK0x%#Px^WH@RwdEDSE1x8O7Lf3CxmKhN{69y^`ysDj9ODk|%B zxq8EXIl8c2iOg8FeL_^|3s3Hp%hp8ct(y|X`}bzog$^z;<~}peym0IH%uqcm(l_yc zA!E>tJ+4K6cDf!rTWOk0HkuXp70YPdOU6w(P&a+|MBVOZug5;O#|dXHslB;N)mhak zo%g&ZcOGq3<->$}c-9BPcp^`}-4v^}9?sFWxW;N9dUPj`;{$D$!O zn8m&_`GvDBz6$xbGS~My?Vdfaf0F-y-Juzxd%ipWb54#IpWOF3)hqwjXAMuLFKELz z9n<}%w#kaJc302*H#T%$&%d?*TdZq|MQ-`)Ic}Mr>}!^c%QFHx2MfxgM`RR^5T&=Kfs7!d=tuO9;p>A~Dal`Isug5;O z$IU^l>XrTB^2otxwQF;|o)`arfVvzyO3e@WK-5NjU%q}MT&tM>t(do>bG7o=`(th% zUlp^s*jqcbzC5V#WfgPdS^T{JThC12P_}R6o&nUCn|~{Fz1P|2{x5pwzoGs&qI%6~>z{v#qTYwsOy(r3Qqr*b#lRsZk#cXYi28K27krK4_t>9^Z0y{hjp z3+8D?htD(G#N1MmvvQ#xb#aXD)u8sDKL4PY6H+d}ed2c6;`d8Ey?lXQalY8q{QDuU ztHtqq_pD6%%>DnAXAj=s*?+AbC!BApgAe{#ZG5Fs7L3>{7c{l05${Y<2|oFuYySDH zOnYylo?#@2wrlI_t}WVsW<1=UU}|LnW~s=E91=X;NS*YYYeie2>)9&@%t_DZnSryn z$h4Mg`UQ2M?hWG}-R@_v$3C~m8_)bz4KI64ttz@ItIcC___b4N&W32^?b-i*FFh$= z6!&RUeV)*welMwT#@!$A6{^ND__x>Y#=6_&itOJwL1!a@q q1qB&=_5BM_O928c11$gm00;m803iUBNQY};lTQXQ2Al=}0001p%xnPw delta 1544 zcmV+j2KV{s4TcSWP)h>@EdT%j2mk;8Apr9DRFT9d)Hrqb$aN)M%&t4Md7lE-=ck5D<< z80i$@ZlYqCq6C7rSWs@tq^3zofHBmVMMkA2J`nFYIF99i<$AYt25loOAL~|TwdJn8 z@Bc8zNKz)MnQFfOna|AsoXfpG{>*po97=APFm_z(c}l)g5H&R;cS=rFTx3+jw7*1o zBBQ3w&Y6>wKI^X8Ia4#_{p9qSxf!ARxtZzN8KLW|V@Je#B4bBhdyOaZ{>Uz^iIWVNIQpCh<%$9wDDngYb!J3 zwAMX;5nA1b1TAlJgDN%O*hg#od!I{ZtF!laMORjl@7#XelFgm_obJr_>(x*n)w5jCN#Podc9#rMfs`F>*qQB zE6U4G|2Mz5TZ~Nfi%r{ii$ODHSSJU(pfB!!cf!iL{z+f(vr1!2VUpvfH4(=7nXSf_ z?n{iYv`4L~Nqc>TJN{ws=^3p{lc%55+*$H7CAr_e%IAHh`mquKl_|j({w_AaMY99t_hX)Mo*F>T142#hkRzoXRNk!4-V9S z;;R?=mhH?nyp=_kbo&F3TkbsfJnr7Ter*46b8GEK;@!8S#pwNgjBF*`R7RHwY5c@2 z5ezR@b7MbNM-*47U-Vs>n3XbD9em#$$K+MD>d)7|qPKDPzwQ2Ib3c5}v-L0Ueb@h0 z%lGPS_uKkcdLC}*bZCeE<$JAA(?_*`8^Y@ie~wp-ULW_p{sT>4p6*|M|4XH{yG4G2 zU-S<3@#f2!)&-x`>II?x*M|BJ+_=ivJ0{uD@=S!WtMV=5pEo~ZOq{XQx^r-|Z%NMu z_TunpT`Iln`04)TXG(H^OQ=Cf&UiTcGIR440kLy$k|?$kjo_GG=8C{FA*HQ#@g_+y;l?bVB%}f!Sx=`);%7F7%6(0X0_ebDuT5*<%epc0@lGztmWtv_+RL zH}kY5BZi3Dlw-aL?>}sPwfsS2;Gnto(G>wpdSObD^ZX+}Pjcs0SNI)&a>mq}8D>`2 z#p3d`ca5@=SHz3GY-L_a#%R_hj zN>9WzR$W}>`}(;WHEBwjy>)!Lk$>sl(YOCsYie`-5cQRa>(t))k=i>?Ojb*#M>(|5FZmf-JhT1ZNB^?9 zj^{jA|GM73{~l>)^nai+vD2X)pMQ++|1ZG$^{vjj>xy6E_xQ=@?CkkRZ{L5{mQ@Io uF$QNG0002^?fVu`O928c11$gm00;m803iVLG)XZ4ld%Rd208`+0000RtSnRj diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/00/rewards.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/00/rewards.npz index 6df9bcd7f6401747ff0f6d69d721e98aa6ac20cf..9460c482c5da531cb3cf9e67a65d6598184460e8 100644 GIT binary patch delta 72 zcmaFJ_>fU3z?+#xmw|zS1BewFUc^26J5eZCOY`ksKJI(($}b4de{g_-js2DT#{-EB P0p5&Ey3A;*S6To7I*k{K delta 72 zcmaFJ_>fU3z?+#xmw|zS1BewF)LNQqCko|i37rn-Yph%^V`qG)Jb|H^`Rn3}2L=oQ O-i%DT%xJ1tS^xl_xe~$v diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/actions.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/01/actions.npz index 3a1e8644d51c0536576a63186cdbc7d849e69c6f..f34a48197239d189bb8ab63d07ee97a89bf36a47 100644 GIT binary patch literal 284 zcmWIWW@gc4U|`??Vnqh$m4?^) z6u`iGVaG4g{Aw=Apa22EU8S2#UOrGcxaWaF)TBp2UcdSOO_-l%b@QZS%#`AXJm3Ak zfB0orAN^%h?KjcYSJut4;4KX6Pm)X8n{79{X!jk{&|kOXPx;Q?wKsOU{L0tO%NLzE zTw!$PaQP0szi$?P`dw3||MUM>vHSh@P&c4a)8{Y*cr!BTGNbwkilm#Q*>R diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/agent_exec_times.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/01/agent_exec_times.npz index fb40f452153ca4708446e64e2161e3a6d036574c..cff127e03086e8823f5bc2f7f097100244e6d897 100644 GIT binary patch delta 108 zcmaFBc!$wAz?+#xmw|zS1BewF3hW}d|3d)>g9t-PVo9Q2UO^=zg8+j76Ho~dgiSQ| oQR{qT@|nX~yqK+x`Rn3}2Zjs*-i%DT%%~=XO&0JHBLiU0rr delta 112 zcmcb^_<+$kz?+#xmw|zS1BewFn4Tu9{D%S#1`&po#F9k4yn;$b1_1^ECZG}^h?;2Z sqb14c);-gZ{|tBKwOPgnGArbdGIuiucr!BTGNYOnHF2pS+Z3=y04FOQO#lD@ diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/disc_lines_cascading_failure.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/01/disc_lines_cascading_failure.npz index 43d425133bd5ea96b6ab4eeecf6921c8f3bf9aa4..8829b9b799b47c95f516a1432a04f18827ac2705 100644 GIT binary patch delta 103 zcmcb{c$3jMz?+#xmw|zS1BewFY~r`5|Azt&1`&po#F9k4yn;$b1_6cz%s?eT5IoV? jPti>xAwh<9ae~MKMuq@yMkZZmR6~L%&NpQ11*-=D?C2So delta 100 zcmcb~c#Y9Gz?+#xmw|zS1BewFR+!&*{SO5k3?d9Ei6x18c?Fe>3<3-bn1M=wAYh`g epWLxP11>j4KOoPWkx7>s)r5eFiwxPiz={FD+t?*hjjRQ(HnzaE_+g(IkVD56&HDD@+a3QL18}eDA2BBgn{ax7wWH=TY{9@*2ew&S_h(&ek;jue^B-#cA%?=(UEyEPi`^WN{) zv_JhddHwtCufOiT|1)Rh?O@T5%kJAh-F$z293#}}IH@1;b_@aDj7+-Bs9^&3GtmE_ bP=bL5uxYRm3h-uS1IaJ~p&5`C0?Psb+L(A| literal 376 zcmWIWW@gc4U|`??VnqgHyLm4Ep@4%ygdrudBvCJ~ppub6fPtY4s00W;K`4f|m-c!w zJBqMf*eLo@a$9t($ixU1!A+TOM5MX3In&s=4L1o&3)Zr)e!}~vhWY;itx9oi#|;J3 z79?bDv5}W~cShI#-Pv>ZzPez@~CD1PepCMdE(aFt8Qg8&rUxok*t1fc^(IU_*RMOyDy(~7d(_L_}F_^ z`O%7!*~|XuUH`sy*ZnK6%lBVC8C2Dt*OUM2Z*baQwYeW(d_4ZQ&;7k??f$jbiWlCm z{CxHOnsBJ6a8eEbzi|e5GcxHiqlOkZG=L!k3O^WVU<9#XVHe=d$_C;y0-+g@)&a`` E0R8)jVgLXD diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json index ee6705ac..f90b9aef 100644 --- a/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_meta.json @@ -3,9 +3,9 @@ "backend_type": "PandaPowerBackend_rte_case5_examplePandaPowerBackend", "chronics_max_timestep": "100", "chronics_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/chronics/01", - "cumulative_reward": 11.967159271240234, + "cumulative_reward": 3.392332077026367, "env_seed": null, "env_type": "Environment_rte_case5_examplePandaPowerBackend", "grid_path": "/home/donnotben/Documents/grid2op/grid2op/data/rte_case5_example/grid.json", - "nb_timestep_played": 3 + "nb_timestep_played": 2 } \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json index d193ede0..3d3956c6 100644 --- a/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/01/episode_times.json @@ -1,12 +1,12 @@ { "Agent": { - "total": 7.814600030542351e-05 + "total": 2.542800211813301e-05 }, "Env": { - "apply_act": 0.007293818984180689, - "observation_computation": 0.002276361919939518, - "powerflow_computation": 0.0539729930460453, - "total": 0.0635431781411171 + "apply_act": 0.002260413020849228, + "observation_computation": 0.0005414449842646718, + "powerflow_computation": 0.033623043447732925, + "total": 0.0364249013364315 }, - "total": 0.06488691300000937 + "total": 0.03700649699749192 } \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info b/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info index 7be2930a..47d0a3b4 100644 --- a/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info +++ b/grid2op/data_test/runner_data/res_agent_1.12.3/01/grid2op.info @@ -1,3 +1,3 @@ { - "version": "1.12.0" + "version": "1.12.3" } \ No newline at end of file diff --git a/grid2op/data_test/runner_data/res_agent_1.12.3/01/observations.npz b/grid2op/data_test/runner_data/res_agent_1.12.3/01/observations.npz index 6b7f9780cfd59cc7a56557262f0b43cb327ee292..54183620bb34bf79ea62054cb8868080525b160b 100644 GIT binary patch delta 946 zcmV;j15NzN3bhD-P)h>@EdT%j2mk;8App9Q+`<3<|NsC0|NjU86aZvlbYU)TaCrd$ z5CDKL0RR91006H800000008aPaZHqT9LMp;{%P`uk+7v0cC^~5J1JOJIPad{^Lwan zBS@{bkTqa&M-Gq%o^~0FSu6k0#b8b$b?2tez%Ba2%(d%(p64Qg4l-fMKUTVwa;wzk zm`z&U4?2&{;_6ykwfA>>-Jaj?`Tg$u{BEDS>nMA=banY0ZIiaeS>tPduF1L5;auf^ z!0B>0{f$i_07KceDm|wFZkl)B?b2vxEuvVg-czI7Drl@p;b*5 zYg((WX_nA`Zj>ebe!qVH;+V1fki#4;z563g8ms|)d#5$peaZcP!^@&%d(gPp5D`jNeNYVdg=F2L+hur1x6wAS)i~R~ zFX~?NmaV+G@l`w7E9uZzu_>y@f+ZKsHN&Omw(=`~a%t#8>A8O1{N=83sq|DwWXod@ z8V5rwMD4D2ch8E=*8J1;cGq~=Qu1~MtdB~_nZ;^WTlxGSal=+e*e6w{A=3f_?i%PGA-YsAQZtvmX` z{PnitSw8x^`ER}wn^N*^Ojhl^t@yoT9cEB}NY4Et+r04XRnvdNhv0t2XSbCN}X(%;yVI$Fh zFL9nkUqy|NZq6zme`b$av2&fwue!%v`^IInaHLZzWqlc@J13xrzwXiVJKH^h{0(~e z_0{?@SDQ!4&E51Tvp8EO)6Td^`ak4f%_Z}ndF1=w)=cMrU?L!r>;9l_%D>t>^S^-l z_f@LgrQ@G?j=z1*RKNdXX8zMF>lFZ#k_2aypacaP|4qLFP)h*@EdT%j2mk;8Apk~ae3bwH|NsC0|NjU86aZvlbYU)TaCrd$ z5CDKL0RR91006@T00000008aQ4NO&K9LMpa&RNdzb!32gb+zjYI>?ua#y#geN6pPl z35$^}WXjbAh@xngCLl`;SWYVe({Ls8tzu>Aa(K_ZU0*MMw=8_AjTug2ST=Q-*n6ch7n5d7l4$?tVKv>mPl5>h#nO$`a*y`<#qLvvcj^Z1#toqwKLZ zyE7+uac=tjw4B^I8FGG7de)+h!2F_l=?gLf*MsBZ;$v;`2@ej5wXLv)Rb7=?Hzp`b zzN#purnHuSsX3iawdvd`y}a6H)K4Asv7*$8kRH0f?ndDIt6F8nk-(Z7&0n`mli!^@ z>=Qj|d?L0m+U=bjW7hAukhnK{xi+PAnSL(YrAfWBmT7)(mB@_lDQe4h=xeVQ>Wzms zdlHj2x}}#FuX4BbYE%7{FG%+2JNRoO$v@R7PQ4_5hE(krj_Xav%>m6q+L`VWD;^%B zZ><`w&E2prap&lzX0MZ3?#kv`QyRD-&pc4S)pKfSKaVT*h+BMG?(XV%UD)TY)usMp zXX;iz>pa%jx<1x$-niaB%}Cr7VYn_gh#!ZZF`{Oi5>morTSS*qLoItQN6qe|s{`}< zs_qPbLtU5Vbx0SY?o&hm_nov??X3?-IF;|Zvp-idb9X+c)$`Um9LPtNCP$4mniiU~ z>GHGqgNa(ZO>fJ;+$)s-yy`=G;_#zlnBx~eKs;?trm>bxFUZx#*6*Dt*@ z(lhD38dF+7v!FHqa!+e~_CsHg?6Gg@W+N%iZuoC55&8_Tm^`r9c*#sAB~r_~{Hpuslo8^m8%3Ib z6cd%ATm7u_SYzvYWo)(KEFNnt+?yl@J#j`f6%-j09!L{Xc2l{iOX#9@C>83$iUW>O zJ^HE9Gg=(kou>pH=-K;k%)g@j{`mire>vBd|5)c1Ei@m>e`ANi?Vszm{L8hW{5O^y z(JO1~#P_~qt@-!Yb(4GR^7(&j{+%a(j*30`KGCbxCw5Gz~=^|Q`njje0{$ZbaQyWXkM)@P3dC7Zg*=0E>f zg%+9)nJWR4fdgcdkOK!A o{>y#^P)h*3<3-SOh6?-5IoV? lM_K;TL_VH`f(3OV{5EV10p5&Ey3DA?1W#OM$kq$i0RVgz8|?r9 delta 109 zcmcb~c$d*Qz?+#xmw|zS1BewFF8IEi^dAa17(^IS5=#>G@(L;$83Y&vn1D)vAbg^+ pkNVzQ>@qoh?~4-{nwh^Yu1GLs2=HcP(q%?9DtzK1L$--vT>yG4AQb=r diff --git a/grid2op/tests/test_Runner.py b/grid2op/tests/test_Runner.py index 9688a29c..2614aafc 100644 --- a/grid2op/tests/test_Runner.py +++ b/grid2op/tests/test_Runner.py @@ -10,6 +10,8 @@ import tempfile import json import unittest +import os +import numpy as np import pdb import packaging from packaging import version @@ -346,7 +348,7 @@ def seed(self, seed): ) # test that the right seeds are assigned to the agent - res = runner.run( + _ = runner.run( nb_episode=3, max_iter=self.max_iter, env_seeds=[1, 2, 3], @@ -356,7 +358,7 @@ def seed(self, seed): # test that is no seeds are set, then the "seed" function of the agent is not called. my_agent.seeds = [] - res = runner.run(nb_episode=3, max_iter=self.max_iter, env_seeds=[1, 2, 3]) + _ = runner.run(nb_episode=3, max_iter=self.max_iter, env_seeds=[1, 2, 3]) assert my_agent.seeds == [] def test_always_same_order(self): @@ -474,11 +476,11 @@ def _aux_backward(self, base_path, g2op_version_txt, g2op_version): assert ( EpisodeData.get_grid2op_version(full_episode_path) == grid2op.__version__ - ), "wrong grid2op version stored (test_version)" + ), f"wrong grid2op version stored (test_version): {EpisodeData.get_grid2op_version(full_episode_path)} vs {grid2op.__version__}" else: assert ( EpisodeData.get_grid2op_version(full_episode_path) == g2op_version - ), "wrong grid2op version stored (>=1.5.0)" + ), f"wrong grid2op version stored (>=1.5.0): loaded version from {full_episode_path} {EpisodeData.get_grid2op_version(full_episode_path)} vs {g2op_version}" def test_backward_compatibility(self): backward_comp_version = [ From b68b29275a9a4aa27ac07731cff5fcc99ca7f66c Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 15:59:11 +0100 Subject: [PATCH 12/16] refacto CI to take less computation time - attempt Signed-off-by: DONNOT Benjamin --- .circleci/config.yml | 27 ++++++++++- grid2op/tests/helper_list_test.py | 48 ++++++++++++++++++- grid2op/tests/test_RewardAlertCostScore.py | 14 ++---- ...est_RewardNewRenewableSourcesUsageScore.py | 1 + 4 files changed, 75 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 90f75038..2ddee9ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,7 @@ executors: - image: cimg/python:3.13 jobs: - test: + test_generic: executor: grid2op-executor resource_class: medium+ parallelism: 4 @@ -70,7 +70,30 @@ jobs: # - store_artifacts: # path: "/Grid2Op/grid2op/tests/test_Action.py" # destination: coverage_artifacts/ - + test_agent: + executor: grid2op-executor + resource_class: small + steps: + - checkout + - run: apt-get update -y + - run: apt-get install -y coinor-cbc + - run: python -m pip install virtualenv + - run: python -m virtualenv venv_test + - run: + command: | + source venv_test/bin/activate + pip install -U pip setuptools wheel + - run: + command: | + source venv_test/bin/activate + pip install -e .[test] + pip freeze + - run: + command: | + source venv_test/bin/activate + cd grid2op/tests/ + python -m unittest -v test_Agent test_AgentFast test_recopowerlineperarea + gen_coverage: executor: grid2op-executor resource_class: small diff --git a/grid2op/tests/helper_list_test.py b/grid2op/tests/helper_list_test.py index dbc27fdd..35efe7cd 100755 --- a/grid2op/tests/helper_list_test.py +++ b/grid2op/tests/helper_list_test.py @@ -1,7 +1,45 @@ #!/usr/bin/env python3 -import sys import unittest +li_tested_elsewhere = [ + # agent (approx 1 min) + "test_Agent", "test_AgentFast", "test_recopowerlineperarea" + # converter (approx 45s) + "test_AgentConverter", "test_Converter", "test_BackendConverter", + # Runner / EpisodeData / "score (3 mins)" + "test_EpisodeData", + "test_runner_kwargs_backend", + "test_Runner", + "test_RunnerFast", + "test_score_idf_2023_assistant", + "test_score_idf_2023_nres", + "test_score_idf_2023", + "test_score_wcci_2022", + "test_AlarmScore", + "test_alert_trust_score", + "test_RewardAlertCostScore", + "test_RewardNewRenewableSourcesUsageScore", + "test_utils", + "test_CompactEpisodeData", + "test_reset_options_runner" + # env in general (1 min) + "test_attached_envs", + "test_attached_envs_compat", + "test_l2rpn_idf_2023", + "test_MultiMix", + "test_timeOutEnvironment", + "test_MaskedEnvironment", + "test_MakeEnv", + "test_multi_steps_env", + "test_simenv_blackout", + # alert / alarm ( 1min) + "test_AlarmFeature", + "test_alert_gym_compat", + "test_alert_obs_act", + "test_alert_trust_score", + "test_AlertReward", + ] +li_tested_elsewhere = [] def print_suite(suite): if hasattr(suite, "__iter__"): @@ -12,7 +50,13 @@ def print_suite(suite): testsuite = suite.__class__.__name__ testmethod = suite._testMethodName test_name = "{}.{}.{}".format(testmodule, testsuite, testmethod) - print(test_name) + do_print = True + for el in li_tested_elsewhere: + if testmodule == el: + do_print = False + break + if do_print: + print(test_name) print_suite(unittest.defaultTestLoader.discover(".")) diff --git a/grid2op/tests/test_RewardAlertCostScore.py b/grid2op/tests/test_RewardAlertCostScore.py index 1c594a0a..8778a2c6 100644 --- a/grid2op/tests/test_RewardAlertCostScore.py +++ b/grid2op/tests/test_RewardAlertCostScore.py @@ -6,24 +6,16 @@ # SPDX-License-Identifier: MPL-2.0 # This file is part of Grid2Op, Grid2Op a testbed platform to model sequential decision making in power systems. -import warnings -import numpy as np import unittest import tempfile import grid2op -from grid2op.Reward import _AlertCostScore, _AlertTrustScore -from grid2op.Agent import DoNothingAgent, BaseAgent +from grid2op.Reward import _AlertCostScore +from grid2op.Agent import BaseAgent from grid2op.tests.helper_path_test import * -from grid2op.Exceptions import Grid2OpException from grid2op.Runner import Runner from grid2op.Observation import BaseObservation from grid2op.Episode import EpisodeData -from grid2op.Parameters import Parameters -from grid2op.Opponent import BaseOpponent, GeometricOpponent -from grid2op.Action import BaseAction, PlayableAction -from _aux_opponent_for_test_alerts import (_get_steps_attack, - TestOpponent - ) +from grid2op.Action import BaseAction ATTACKED_LINE = "48_50_136" diff --git a/grid2op/tests/test_RewardNewRenewableSourcesUsageScore.py b/grid2op/tests/test_RewardNewRenewableSourcesUsageScore.py index b09188f4..2afed2a8 100644 --- a/grid2op/tests/test_RewardNewRenewableSourcesUsageScore.py +++ b/grid2op/tests/test_RewardNewRenewableSourcesUsageScore.py @@ -14,6 +14,7 @@ from grid2op.Reward import _NewRenewableSourcesUsageScore from grid2op.Agent import DoNothingAgent, BaseAgent + class CurtailTrackerAgent(BaseAgent): def __init__(self, action_space, gen_renewable, gen_pmax, curtail_level=1.): super().__init__(action_space) From 9c9a626b917f55265f32ff330e2c026002d066cf Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 16:00:21 +0100 Subject: [PATCH 13/16] refacto CI to take less computation time - attempt Signed-off-by: DONNOT Benjamin --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ddee9ea..313a4aba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -469,7 +469,8 @@ workflows: version: 2.1 test: jobs: - - test + - test_generic + - test_agent - legacy_lightsim_old_pp - legacy_lightsim - test_chronix2grid From d23a11c351f7e42784e9d3846648fb734a5550f1 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 16:11:52 +0100 Subject: [PATCH 14/16] refacto CI to take less computation time - attempt Signed-off-by: DONNOT Benjamin --- .circleci/config.yml | 104 +++++++++++++++++++++++++++++- grid2op/tests/helper_list_test.py | 3 +- 2 files changed, 103 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 313a4aba..605e9bdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,8 +92,104 @@ jobs: command: | source venv_test/bin/activate cd grid2op/tests/ - python -m unittest -v test_Agent test_AgentFast test_recopowerlineperarea - + python -m unittest -v test_Agent test_AgentsFast test_recopowerlineperarea + + test_converter: + executor: grid2op-executor + resource_class: small + steps: + - checkout + - run: apt-get update -y + - run: apt-get install -y coinor-cbc + - run: python -m pip install virtualenv + - run: python -m virtualenv venv_test + - run: + command: | + source venv_test/bin/activate + pip install -U pip setuptools wheel + - run: + command: | + source venv_test/bin/activate + pip install -e .[test] + pip freeze + - run: + command: | + source venv_test/bin/activate + cd grid2op/tests/ + python -m unittest -v test_AgentConverter test_Converter test_BackendConverter + + test_runner_epdata_score: + executor: grid2op-executor + resource_class: small + steps: + - checkout + - run: apt-get update -y + - run: apt-get install -y coinor-cbc + - run: python -m pip install virtualenv + - run: python -m virtualenv venv_test + - run: + command: | + source venv_test/bin/activate + pip install -U pip setuptools wheel + - run: + command: | + source venv_test/bin/activate + pip install -e .[test] + pip freeze + - run: + command: | + source venv_test/bin/activate + cd grid2op/tests/ + python -m unittest -v test_EpisodeData test_runner_kwargs_backend test_Runner test_RunnerFast test_score_idf_2023_assistant test_score_idf_2023_nres test_score_idf_2023 test_score_wcci_2022 test_AlarmScore test_RewardAlertCostScore test_RewardNewRenewableSourcesUsageScore test_utils test_CompactEpisodeData test_reset_options_runner + + test_env_general: + executor: grid2op-executor + resource_class: small + steps: + - checkout + - run: apt-get update -y + - run: apt-get install -y coinor-cbc + - run: python -m pip install virtualenv + - run: python -m virtualenv venv_test + - run: + command: | + source venv_test/bin/activate + pip install -U pip setuptools wheel + - run: + command: | + source venv_test/bin/activate + pip install -e .[test] + pip freeze + - run: + command: | + source venv_test/bin/activate + cd grid2op/tests/ + python -m unittest -v test_attached_envs test_attached_envs_compat test_l2rpn_idf_2023 test_MultiMix test_timeOutEnvironment test_MaskedEnvironment test_MakeEnv test_multi_steps_env test_simenv_blackout + + test_alert_alarm: + executor: grid2op-executor + resource_class: small + steps: + - checkout + - run: apt-get update -y + - run: apt-get install -y coinor-cbc + - run: python -m pip install virtualenv + - run: python -m virtualenv venv_test + - run: + command: | + source venv_test/bin/activate + pip install -U pip setuptools wheel + - run: + command: | + source venv_test/bin/activate + pip install -e .[test] + pip freeze + - run: + command: | + source venv_test/bin/activate + cd grid2op/tests/ + python -m unittest -v test_AlarmFeature test_alert_gym_compat test_alert_obs_act test_alert_trust_score test_AlertReward + gen_coverage: executor: grid2op-executor resource_class: small @@ -471,6 +567,10 @@ workflows: jobs: - test_generic - test_agent + - test_converter + - test_runner_epdata_score + - test_env_general + - test_alert_alarm - legacy_lightsim_old_pp - legacy_lightsim - test_chronix2grid diff --git a/grid2op/tests/helper_list_test.py b/grid2op/tests/helper_list_test.py index 35efe7cd..47020506 100755 --- a/grid2op/tests/helper_list_test.py +++ b/grid2op/tests/helper_list_test.py @@ -2,7 +2,7 @@ import unittest li_tested_elsewhere = [ # agent (approx 1 min) - "test_Agent", "test_AgentFast", "test_recopowerlineperarea" + "test_Agent", "test_AgentsFast", "test_recopowerlineperarea" # converter (approx 45s) "test_AgentConverter", "test_Converter", "test_BackendConverter", # Runner / EpisodeData / "score (3 mins)" @@ -15,7 +15,6 @@ "test_score_idf_2023", "test_score_wcci_2022", "test_AlarmScore", - "test_alert_trust_score", "test_RewardAlertCostScore", "test_RewardNewRenewableSourcesUsageScore", "test_utils", From 3ca1a46f7b7688fd990b819694024ae35667bb5a Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 16:39:43 +0100 Subject: [PATCH 15/16] refacto CI Signed-off-by: DONNOT Benjamin --- .circleci/config.yml | 25 +++++++++++++++++++++++++ grid2op/tests/helper_list_test.py | 21 +++++++++++++-------- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 605e9bdb..0de1ae3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -189,6 +189,30 @@ jobs: source venv_test/bin/activate cd grid2op/tests/ python -m unittest -v test_AlarmFeature test_alert_gym_compat test_alert_obs_act test_alert_trust_score test_AlertReward + + test_issue: + executor: grid2op-executor + resource_class: small + steps: + - checkout + - run: apt-get update -y + - run: apt-get install -y coinor-cbc + - run: python -m pip install virtualenv + - run: python -m virtualenv venv_test + - run: + command: | + source venv_test/bin/activate + pip install -U pip setuptools wheel + - run: + command: | + source venv_test/bin/activate + pip install -e .[test] + pip freeze + - run: + command: | + source venv_test/bin/activate + cd grid2op/tests/ + python -m unittest -v test_issue_* gen_coverage: executor: grid2op-executor @@ -571,6 +595,7 @@ workflows: - test_runner_epdata_score - test_env_general - test_alert_alarm + - test_issue - legacy_lightsim_old_pp - legacy_lightsim - test_chronix2grid diff --git a/grid2op/tests/helper_list_test.py b/grid2op/tests/helper_list_test.py index 47020506..31b33cfe 100755 --- a/grid2op/tests/helper_list_test.py +++ b/grid2op/tests/helper_list_test.py @@ -2,7 +2,7 @@ import unittest li_tested_elsewhere = [ # agent (approx 1 min) - "test_Agent", "test_AgentsFast", "test_recopowerlineperarea" + "test_Agent", "test_AgentsFast", "test_recopowerlineperarea", # converter (approx 45s) "test_AgentConverter", "test_Converter", "test_BackendConverter", # Runner / EpisodeData / "score (3 mins)" @@ -19,7 +19,7 @@ "test_RewardNewRenewableSourcesUsageScore", "test_utils", "test_CompactEpisodeData", - "test_reset_options_runner" + "test_reset_options_runner", # env in general (1 min) "test_attached_envs", "test_attached_envs_compat", @@ -36,9 +36,10 @@ "test_alert_obs_act", "test_alert_trust_score", "test_AlertReward", + # TODO simulate + # TODO curtailment ] -li_tested_elsewhere = [] def print_suite(suite): if hasattr(suite, "__iter__"): @@ -48,12 +49,16 @@ def print_suite(suite): testmodule = suite.__class__.__module__ testsuite = suite.__class__.__name__ testmethod = suite._testMethodName - test_name = "{}.{}.{}".format(testmodule, testsuite, testmethod) do_print = True - for el in li_tested_elsewhere: - if testmodule == el: - do_print = False - break + if testmodule.startswith("test_issue_"): + # the test_issue_* will be tested elsewhere + do_print = False + else: + for el in li_tested_elsewhere: + if testmodule == el: + do_print = False + break + test_name = "{}.{}.{}".format(testmodule, testsuite, testmethod) if do_print: print(test_name) From f8218bde71545c231117cca039cd41df42f6967c Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Wed, 4 Feb 2026 16:52:55 +0100 Subject: [PATCH 16/16] forget to add an env variable Signed-off-by: DONNOT Benjamin --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0de1ae3d..a82b4eb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,6 +91,7 @@ jobs: - run: command: | source venv_test/bin/activate + export _GRID2OP_FORCE_TEST=1 cd grid2op/tests/ python -m unittest -v test_Agent test_AgentsFast test_recopowerlineperarea @@ -115,6 +116,7 @@ jobs: - run: command: | source venv_test/bin/activate + export _GRID2OP_FORCE_TEST=1 cd grid2op/tests/ python -m unittest -v test_AgentConverter test_Converter test_BackendConverter @@ -139,6 +141,7 @@ jobs: - run: command: | source venv_test/bin/activate + export _GRID2OP_FORCE_TEST=1 cd grid2op/tests/ python -m unittest -v test_EpisodeData test_runner_kwargs_backend test_Runner test_RunnerFast test_score_idf_2023_assistant test_score_idf_2023_nres test_score_idf_2023 test_score_wcci_2022 test_AlarmScore test_RewardAlertCostScore test_RewardNewRenewableSourcesUsageScore test_utils test_CompactEpisodeData test_reset_options_runner @@ -163,6 +166,7 @@ jobs: - run: command: | source venv_test/bin/activate + export _GRID2OP_FORCE_TEST=1 cd grid2op/tests/ python -m unittest -v test_attached_envs test_attached_envs_compat test_l2rpn_idf_2023 test_MultiMix test_timeOutEnvironment test_MaskedEnvironment test_MakeEnv test_multi_steps_env test_simenv_blackout @@ -187,6 +191,7 @@ jobs: - run: command: | source venv_test/bin/activate + export _GRID2OP_FORCE_TEST=1 cd grid2op/tests/ python -m unittest -v test_AlarmFeature test_alert_gym_compat test_alert_obs_act test_alert_trust_score test_AlertReward @@ -211,6 +216,7 @@ jobs: - run: command: | source venv_test/bin/activate + export _GRID2OP_FORCE_TEST=1 cd grid2op/tests/ python -m unittest -v test_issue_*