Grid2op

Latest version: v1.10.5

Safety actively analyzes 702445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 11

1.9.1

--------------------
- [BREAKING] (slightly): default `gym_compat` module now inherit from `gymnasium` (if
gymnasium is installed) instead of `gym`. If you want legacy behaviour,
do not install `gymnasium`. If you want compatibility with sota softwares using `gymnasium`,
install it and continue using grid2op transparently. See doc of `gym_compat` module for more
information.
- [BREAKING] remove the support of the "raise_alarm" kwargs in the DiscreteActSpace
- [BREAKING] remove support for python 3.7 that has reached end of life on 2023-06-27 on
pypi and on CI
- [BREAKING] to avoid misleading behaviour, by default the `BoxGymActSpace` no longer uses
the "discrete" attributes ("set_line_status", "change_line_status", "set_bus", "change_bus"). You can
still use them in the "attr_to_keep" kwargs if you want.
- [BREAKING] rename with filename starting with lowercase all the files in the "Reward" module. This is
both consistent with python practice but allows also to make the difference between the file in the
module and the class imported. This should have little to no impact on all codes but to "upgrade"
instead of `from grid2op.Reward.BaseReward import BaseReward` just do
`from grid2op.Reward import BaseReward`.
- [FIXED] an error when an environment with alarm was created before an environment
without alert. This lead to a crash when creating the second environment. This is now fixed.
- [FIXED] an issue with non renewable generators in `GymActionSpace` (some curtailment was made
at 100% of their capacity instead of "no curtailment")
- [FIXED] a bug in computing the datatype of `BoxGymActSpace` and `BoxGymObsSpace` leading to
using "bool" as dtype when it should be int.
- [FIXED] the behaviour of `BoxGymActSpace` when `subtract` / `divide` were provided (the dtype was
not propagated correctly)
- [ADDED] support for the "alert" feature (see main doc page) with new observation attributes
(`obs.active_alert`, `obs.time_since_last_alert`, `obs.alert_duration`, `obs.total_number_of_alert,`
`obs.time_since_last_attack`, `obs.was_alert_used_after_attack` and `obs.attack_under_alert`)
a new type of action: `act.raise_alert` and a new reward class `AlertReward` (among others)
- [ADDED] the environment "l2rpn_idf_2023" (accessible via `grid2op.make("l2rpn_idf_2023", test=True)`)
- [ADDED] the `RecoPowerlinePerArea` that is able to reconnect multiple lines in different area in
the same action
- [ADDED] the kwargs "with_numba" in `PandaPowerBackend` to offer more control on whether or not you want
to use numba (default behaviour did not change: "if numba is availble, use it" but now you can disable it
if numba is available but you don't want it)
- [ADDED] the method `act.decompose_as_unary_actions(...)` to automatically
decompose a "complex" action on its unary counterpart.
- [ADDED] the env attribute `env._reward_to_obs` that allows to pass information to the observation directly
from the reward (this can only be used by regular environment and not by `obs.simulate` nor by `ForecastEnv`)
- [ADDED] the whole "alert" concept in grid2op with a grid2op environment supporting it (`l2rpn_idf_2023`)
- [ADDED] the `gym_env.action_space.get_index(attr_nm)` for `BoxGymActSpace` that allows to retrieve which index
of the action represents which attribute.
- [ADDED] the argument `quiet_warnings` in the handlers to prevent the issue of too many warnings when using
`ForecastHandler`
- [IMPROVED] the method `act.as_serializable_dict()` to work better when exporting / importing actions on different
grids (the output dictionary for `set_bus` and `change_bus` now split the keys between all elements types
instead of relying on the "topo_vect" order (which might vary))
- [IMPROVED] consistency between how to perform action on storage units between "raw" grid2op,
`GymActionSpace`, `BoxGymActSpace`, `DiscreteActSpace` and `MultiDiscreteActSpace` (
used to be a mix of `set_storage` and `storage_power` now it's consistent and is `set_storage` everywhere)
- [IMPROVED] error message when the "stat.clear_all()" function has been called on a statistic and this same
statistic is reused.
- [IMPROVED] possibility to set "other_rewards" in the config file of the env

1.9.0

--------------------
- [BREAKING] (because prone to bug): force the environment name in the `grid2op.make` function.
- [BREAKING] because bugged... The default behaviour for `env.render()` is now "rgb_array". The mode
"human" has been removed because it needs some fixes. This should not impact lots of code.
- [BREAKING] the "maintenance_forecast" file is deprecated and is no longer used (this should not
not impact anything)
- [BREAKING] the attribute "connected" as been removed in the edges of the observation converted as
as a networkx graph. It is replaced by a "nb_connected" attribute. More information on the doc.
- [BREAKING] the function "obs.as_networkx" will be renamed "`obs.get_energy_graph`" and the
description has been adapted.
- [BREAKING] In `PandaPowerBackend` the kwargs argument "ligthsim2grid" was misspelled and is now properly
renamed `lightsim2grid`
- [BREAKING] you can no longer use the `env.reactivate_forecast()` in the middle of an episode.
- [BREAKING] the method `runner.run_one_episode()` (that should not use !) now
returns also the total number of steps of the environment.
- [FIXED] a bug in `PandapowerBackend` when running in dc mode (voltages were not read correctly
from the generators)
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/389 which was caused by 2 independant things:

1) the `PandapowerBackend` did not compute the `theta` correctly on powerline especially if
they are connected to a disconnected bus (in this case I chose to put `theta=0`)
2) the `obs.get_energy_graph` (previously `obs.as_networkx()`) method did not check,
when updating nodes attributes if powerlines
were connected or not, which was wrong in some cases

- [FIXED] the `N1Reward` that was broken
- [FIXED] the `act._check_for_ambiguity`: a case where missing (when you used topology to disconnect a powerline,
but also set_bus to connect it)
- [FIXED] a bug when the storage unit names where not set in the backend and needed to be set
automatically (wrong names were used)
- [FIXED] a bug in `PandaPowerBackend` when using `BackendConverter` and one the backend do not support shunts.
- [FIXED] 2 issues related to gym env: https://github.com/Grid2Op/grid2op/issues/407 and
https://github.com/Grid2Op/grid2op/issues/418
- [FIXED] some bus in the `obs.get_energy_graph` (previously `obs.as_networkx()`) for the cooldowns of substation
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/396
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/403
- [FIXED] a bug in `PandaPowerBackend` when it was copied (the kwargs used to build it were not propagated)
- [FIXED] a bug in the `Runner` when the time series class used is not `MultiFolder` (*eg* `GridStateFromFile`): we could
not run twice the same environment.
- [FIXED] a bug n the `GridStateFromFile`, `GridStateFromFileWithForecasts` and
`GridStateFromFileWithForecastsWithoutMaintenance` classes that caused the maintenance file to be
ignored when "chunk_size" was set.
- [FIXED] a bug when shunts were alone in `backend.check_kirchoff()`
- [FIXED] an issue with "max_iter" in the runner when `MultifolderWithCache`
(see issue https://github.com/Grid2Op/grid2op/issues/447)
- [FIXED] a bug in `MultifolderWithCache` when seeding was applied
- [ADDED] the function `obs.get_forecast_env()` that is able to generate a grid2op environment from the
forecasts data in the observation. This is especially useful in model based RL.
- [ADDED] an example on how to write a backend.
- [ADDED] some convenient function of `gridobject` class to convert back and forth "local bus id" (1 or 2) to
"global bus id" (0, 1, 2, ... 2*n_sub) [see `gridobject.global_bus_to_local` or `gridobject.local_bus_to_global`]
- [ADDED] a step by step (very detailed) example on how to build a Backend from an existing grid "solver".
- [ADDED] some test when the shunt bus are modified.
- [ADDED] a function to get the "elements graph" from the grid2op observation (represented as a networkx graph)
as well as its description on the documentation.
- [ADDED] a method to retrieve the "elements graph" (see doc) fom an observation `obs.get_elements_graph()`
- [ADDED] a whole new way to deal with input time series data (see the module `grid2op.Chronics.handlers`
for more information)
- [ADDED] possibility to change the parameters used for the `obs.simulate(...)`
directly from the grid2op action, see `obs.change_forecast_parameters()`
- [ADDED] possibility to retrieve a "forecast environment" with custom forecasts, see
`obs.get_env_from_external_forecasts(...)`
- [ADDED] now requires "importlib-metadata" package at install
- [ADDED] adding the `TimedOutEnvironment` that takes "do nothing" actions when the agent
takes too much time to compute. This involves quite some changes in the runner too.
- [ADDED] Runner is now able to store if an action is legal or ambiguous
- [ADDED] experimental support to count the number of "high resolution simulator" (`obs.simulate`,
`obs.get_simulator` and `obs.get_forecast_env`) in the environment (see
https://github.com/Grid2Op/grid2op/issues/417). It might not work properly in distributed settings
(if the agents uses parrallel processing or if MultiProcessEnv is used), in MultiMixEnv, etc.
- [ADDED] it now possible to check the some rules based on the definition of
areas on the grid.
- [IMPROVED] possibility to "chain" the call to simulate when multiple forecast
- [IMPROVED] possibility to "chain" the call to simulate when multiple forecasts
horizon are available.
- [IMPROVED] the `GridStateFromFileWithForecasts` is now able to read forecast from multiple steps
ahead (provided that it knows the horizons in its constructor)
- [IMPROVED] documentation of the gym `DiscreteActSpace`: it is now explicit that the "do nothing" action
is by default encoded by `0`
- [IMPROVED] documentation of `BaseObservation` and its attributes
- [IMPROVED] `PandapowerBackend` can now be loaded even if the underlying grid does not converge in `AC` (but
it should still converge in `DC`) see https://github.com/Grid2Op/grid2op/issues/391
- [IMPROVED] `obs.get_energy_graph` (previously `obs.as_networkx()`) method:
almost all powerlines attributes can now be read from the
resulting graph object.
- [IMPROVED] possibility to set `data_feeding_kwargs` from the config file directly.
- [IMPROVED] so "FutureWarnings" are silenced (depending on pandas and pandapower version)
- [IMPROVED] error messages when "env.reset()" has not been called and some functions are not available.
- [IMPROVED] `act.remove_line_status_from_topo` can now be used without an observation and will "remove"
all the impact on line status from the topology if it causes "AmbiguousAction" (this includes removing
`set_bus` to 1 or 2 with `set_line_status` is -1 or to remove `set_bus` to -1 when `set_line_status` is 1
or to remove `change_bus` when `set_line_status` is -1)
- [IMPROVED] possibility, for `BackendConverter` to converter between backends where one does support
storage units (the one making powerflow) and the other one don't (the one the user will see).
- [IMPROVED] in `BackendConverter` names of the "source backend" can be used to match the time series data
when the "use_target_backend_name=True" (new kwargs)
- [IMPROVED] environment do not crash when it fails to load redispatching data. It issues a warning and continue as if
the description file was not present.
- [IMPROVED] `BackendConverter` is now able to automatically map between different backend with different naming convention
under some hypothesis. CAREFUL: the generated mapping might not be the one you "have in mind" ! As for everything automatic,
it's good because it's fast. It's terrible when you think it does something but in fact it does something else.
- [IMPROVED] the `obs.get_energy_graph` (previously `obs.as_networkx()`) method with added attributes for edges (origin and extremity substation, as well as origin and
extremity buses)
- [IMPROVED] the doc of the `obs.get_energy_graph` (previously `obs.as_networkx()`)
- [IMPROVED] it is now possible to use a different backend, a different grid or different kwargs between the
env backend and the obs backend.
- [IMPROVED] the environment now called the "chronics_handler.forecast" function at most once per step.
- [IMPROVED] make it easier to create an environment without `MultiFolder` or `MultifolderWithCache`
- [IMPROVED] add the possibility to forward kwargs to chronix2grid function when calling `env.generate_data`
- [IMPROVED] when calling `env.generate_data` an extra file (json) will be read to set default values
passed to `chronix2grid.add_data`
- [IMPROVED] it is no more reasonably possible to misuse the `MultifolderWithCache` (for example by
forgetting to `reset()` the cache): an error will be raised in case the proper function has not been called.
- [IMPROVED] possibility to pass game rules by instance of object and not by class.
- [IMPROVED] it should be faster to use the "Simulator" (an useless powerflow was run)

1.8.1

---------------------
- [FIXED] a deprecation with numpy>= 1.24 (**eg** np.bool and np.str)
- [ADDED] the baseAgent class now has two new template methods `save_state` and `load_state` to save and
load the agent's state during Grid2op simulations. Examples can be found in L2RPN baselines (PandapowerOPFAgent and curriculumagent).
- [IMPROVED] error message in pandapower backend when the grid do not converge due to disconnected
generators or loads.

1.8.0

---------------------
- [BREAKING] now requires numpy >= 1.20 to work (otherwise there are
issues with newer versions of pandas).
- [BREAKING] issue https://github.com/Grid2Op/grid2op/issues/379 requires
different behaviour depending on installed gym package.
- [BREAKING] cooldowns are not consistent between `env.step` and `obs.simulate`.
If `obs.time_before_cooldown_line[l_id] > 0` it will be illegal, at the next call to `env.step`
(and `obs.simulate`) to modify the status of this powerline `l_id`. Same for
`obs.time_before_cooldown_sub[s_id] > 0` if trying to modify topology of
substation `s_id`. This also impacts the maintenances and hazards.
This is also linked to github issue https://github.com/Grid2Op/grid2op/issues/148
- [FIXED] a bug when using a `Runner` with an environment that has
been copied (see https://github.com/Grid2Op/grid2op/issues/361)
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/358
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/363
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/364
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/365 and
https://github.com/Grid2Op/grid2op/issues/376 . Now the function(s)
`gridobj.process_shunt_data` and `gridobj.process_grid2op_shunt_data` are called
`gridobj.process_shunt_static_data`
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/367
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/369
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/374
- [FIXED] issue https://github.com/Grid2Op/grid2op/issues/377 by adding a special
method `backend.update_thermal_limit_from_vect`
- [ADDED] the "`packaging`" python package is now required to install grid2op.
It allows to support different `gym` versions that changes behavior regarding
numpy pseudo random generator.
- [ADDED] the function `act.remove_line_status_from_topo` to ignore the line status modification
that would be induced by "set_bus" or "change_bus" when some cooldown applies on the powerline.
- [IMPROVED] clarify documentation of gym compat module (see
https://github.com/Grid2Op/grid2op/issues/372 and
https://github.com/Grid2Op/grid2op/issues/373) as well as the doc
for MultifolderWithCache (see https://github.com/Grid2Op/grid2op/issues/370)

1.7.2

--------------------
- [FIXED] seeding issue https://github.com/Grid2Op/grid2op/issues/331
- [FIXED] clarify doc about fixed size matrices / graphs https://github.com/Grid2Op/grid2op/issues/330
- [FIXED] improved the behaviour of `obs._get_bus_id` and `obs._aux_fun_get_bus` : when some objects were on busbar 2
they had a "wrong" bus id (it was lagged by 1) meaning an empty "bus" was introduced.
- [FIXED] an issue with `obs.state_of(...)` when inspecting storage units
(see https://github.com/Grid2Op/grid2op/issues/340)
- [FIXED] an issue with `act0 + act1` when curtailment was applied
(see https://github.com/Grid2Op/grid2op/issues/340)
- [FIXED] a slight "bug" in the formula to compute the redispatching cost for L2RPN 2022 competition.
- [IMPROVED] possibility to pass the env variable `_GRID2OP_FORCE_TEST` to force the flag
of "test=True" when creating an environment. This is especially useful when testing to prevent
downloading of data.
- [IMPROVED] support of "kwargs" backend arguments in `MultiMixEnv` see first
item of version 1.7.1 below

1.7.1

-----------------------
- [BREAKING] The possibility to propagate keyword arguments between the environment
and the runner implied adding some arguments in the constructor of
`PandapowerBackend`. So if you made a class that inherit from it, you should
add these arguments in the constructor (otherwise you will not be able to use
the runner) [This should not impact lot of codes, if any]
- [FIXED] a documentation issue https://github.com/Grid2Op/grid2op/issues/281
- [FIXED] a bug preventing to use the `FromChronix2grid` chronics class when
there is an opponent on the grid.
- [FIXED] a documentation issue https://github.com/Grid2Op/grid2op/issues/319
on notebook 11
- [FIXED] some issues when the backend does not support shunts data (caused during the
computation of the size of the observation) Tests are now performed in
`grid2op/tests/test_educpp_backend.py`
- [FIXED] a bug when downloading an environment when the archive name is not the
same as the environment names (attempt to delete a non existing folder). This
is the case for `l2rpn_wcci_2022` env. For this env, your are forced to use
grid2op version >= 1.7.1
- [FIXED] an issue when converting a "done" action as a graph, see
https://github.com/Grid2Op/grid2op/issues/327
- [ADDED] score function for the L2RPN WCCI 2022 competition
- [IMPROVED] adding the compatibility with logger in the reward functions.
- [IMPROVED] when there is a game over caused by redispatching, the observation is
not updated, as it is the case for other type of game over (improved consistency)
- [IMPROVED] it is now possible to make an environment with a backend that
cannot be copied.
- [IMPROVED] the arguments used to create a backend can be (if used properly)
re used (without copy !) when making a `Runner` from an environment for example.
- [IMPROVED] description and definition of `obs.curtailment_limit_effective` are now
consistent (issue https://github.com/Grid2Op/grid2op/issues/321)

Page 3 of 11

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.