Skip to content

Releases: rte-france/Grid2Op

Release v1.10.1

18 Mar 11:09
Compare
Choose a tag to compare
  • [FIXED] issue #593
  • [FIXED] backward compatibility issues with "oldest" lightsim2grid versions
    (now tested in basic settings)
  • [ADDED] a "compact" way to store the data in the Runner
  • [IMPROVED] the "train_val_split" functions, now more names (for the folders)
    can be used

Release v1.10.0

07 Mar 09:58
Compare
Choose a tag to compare
  • [BREAKING] the order of the actions in env.action_space.get_all_unitary_line_set and
    env.action_space.get_all_unitary_topologies_set might have changed (this is caused
    by a rewriting of these functions in case there is not 2 busbars per substation)
  • [FIXED] github CI did not upload the source files
  • [FIXED] l2rpn_utils module did not stored correctly the order
    of actions and observation for wcci_2020
  • [FIXED] 2 bugs detected by static code analysis (thanks sonar cloud)
  • [FIXED] a bug in act.get_gen_modif (vector of wrong size was used, could lead
    to some crashes if n_gen >= n_load)
  • [FIXED] a bug in act.as_dict when shunts were modified
  • [FIXED] a bug affecting shunts: sometimes it was not possible to modify their p / q
    values for certain values of p or q (an AmbiguousAction exception was raised wrongly)
  • [FIXED] a bug in the _BackendAction: the "last known topoolgy" was not properly computed
    in some cases (especially at the time where a line was reconnected)
  • [FIXED] MultiDiscreteActSpace and DiscreteActSpace could be the same classes
    on some cases (typo in the code).
  • [FIXED] a bug in MultiDiscreteActSpace : the "do nothing" action could not be done if one_sub_set (or one_sub_change)
    was selected in attr_to_keep
  • [ADDED] a method gridobj.topo_vect_element() that does the opposite of gridobj.xxx_pos_topo_vect
  • [ADDED] a mthod gridobj.get_powerline_id(sub_id) that gives the
    id of all powerlines connected to a given substation
  • [ADDED] a convenience function obs.get_back_to_ref_state(...)
    for the observation and not only the action_space.
  • [IMPROVED] handling of "compatibility" grid2op version
    (by calling the relevant things done in the base class
    in BaseAction and BaseObservation) and by using the from packaging import version
    to check version (instead of comparing strings)
  • [IMPROVED] slightly the code of check_kirchoff to make it slightly clearer
  • [IMRPOVED] typing and doc for some of the main classes of the Action module
  • [IMRPOVED] typing and doc for some of the main classes of the Observation module
  • [IMPROVED] methods gridobj.get_lines_id, gridobj.get_generators_id, gridobj.get_loads_id
    gridobj.get_storages_id are now class methods and can be used with type(env).get_lines_id(...)
    or act.get_lines_id(...) for example.
  • [IMPROVED] obs.get_energy_graph() by giving the "local_bus_id" and the "global_bus_id"
    of the bus that represents each node of this graph.
  • [IMPROVED] obs.get_elements_graph() by giving access to the bus id (local, global and
    id of the node) where each element is connected.
  • [IMPROVED] description of the different graph of the grid in the documentation.
  • [IMPROVED] type hints for the gym_compat module (more work still required in this area)
  • [IMPROVED] the MultiDiscreteActSpace to have one "dimension" controling all powerlines
    (see "one_line_set" and "one_line_change")
  • [IMPROVED] doc at different places, including the addition of the MDP implemented by grid2op.

Release v1.9.8

26 Jan 09:34
Compare
Choose a tag to compare
  • [FIXED] the backend.check_kirchoff function was not correct when some elements were disconnected
    (the wrong columns of the p_bus and q_bus was set in case of disconnected elements)
  • [FIXED] PandapowerBackend, when no slack was present
  • [FIXED] the "BaseBackendTest" class did not correctly detect divergence in most cases (which lead
    to weird bugs in failing tests)
  • [FIXED] an issue with imageio having deprecated the fps kwargs (see #569)
  • [FIXED] adding the "loads_charac.csv" in the package data
  • [FIXED] a bug when using grid2op, not "utils.py" script could be used (see
    #577). This was caused by the modification of
    sys.path when importing the grid2op test suite.
  • [ADDED] A type of environment that does not perform the "emulation of the protections"
    for some part of the grid (MaskedEnvironment) see #571
  • [ADDED] a "gym like" API for reset allowing to set the seed and the time serie id directly when calling
    env.reset(seed=.., options={"time serie id": ...})
  • [IMPROVED] the CI speed: by not testing every possible numpy version but only most ancient and most recent
  • [IMPROVED] Runner now test grid2op version 1.9.6 and 1.9.7
  • [IMPROVED] refacto gridobj_cls._clear_class_attribute and gridobj_cls._clear_grid_dependant_class_attributes
  • [IMPROVED] the bahviour of the generic class MakeBackend used for the test suite.
  • [IMPROVED] re introducing python 12 testing
  • [IMPROVED] error messages in the automatic test suite (AAATestBackendAPI)

Release v1.9.7

01 Dec 09:42
Compare
Choose a tag to compare
  • [BREAKING] removal of the grid2op/Exceptions/PowerflowExceptions.py file and move the
    DivergingPowerflow as part of the BackendException. If you imported (to be avoided)
    with from grid2op.Exceptions.PowerflowExceptions import PowerflowExceptions
    simply do from grid2op.Exceptions import PowerflowExceptions and nothing
    will change.
  • [BREAKING] rename with filename starting with lowercase all the files in the "Exceptions",
    module. This is both consistent with python practice but allows also to make the
    difference between the files in the
    module and the class imported. This should have little to no impact on all codes but to "upgrade"
    instead of from grid2op.Exceptions.XXX import PowerflowExceptions (which you should not have done in the first place)
    just do from grid2op.Exceptions import PowerflowExceptions. Expect other changes like this for other grid2op modules
    in the near future.
  • [BREAKING] change the gridobj_cls.shape() and gridobj_cls.dtype() to gridobj_cls.shapes() and gridobj_cls.dtypes()
    to be more clear when dealing with action_space and observation_space (where shape and dtype are attribute and not functions)
    This change means you can still use act.shape() and act.dtype() but that act_space.shape and act_space.dtype are now
    clearly properties (and NOT attribute). For the old function gridobj_cls.dtype() you can now use gridobj_cls.dtypes()
  • [FIXED] issue #561 (indent issue)
  • [FIXED] issue #550 : issue with shunts_data_available now better handled
  • [IMPROVED] the function to check the backend interface now also check that
    the topo_vect returns value between 1 and 2.
  • [IMPROVED] the function to check backend now also check the topo_vect
    for each type of elements.

Release v1.9.6

26 Oct 14:11
Compare
Choose a tag to compare
  • [BREAKING] when a storage is connected alone on a bus, even if it produces / absorbs 0.0 MW it
    will raise a diverging powerflow error (previously the storage was automatically disconnected by
    PandaPowerBackend, but probably not by other backends)
  • [BREAKING] when a shunt is alone on a bus, the powerflow will diverge even in DC mode
    (previously it only converges which was wrong behaviour: grid2op should not disconnect shunt)
  • [FIXED] a bug in PandaPowerBackend (DC mode) where isolated load did not raised
    exception (they should lead to a divergence)
  • [FIXED] some wrong behaviour in the remove_line_status_from_topo when no observation where provided
    and check_cooldown is False
  • [FIXED] a bug in PandaPowerBackend in AC powerflow: disconnected storage unit had no 0. as voltage
  • [FIXED] a bug in PandaPowerBackend in AC powerflow when a generator was alone a bus it made the powerflow
    crash on some cases (eg without lightsim2grid, without numba)
  • [FIXED] a bug in PandaPowerBackend in DC (in some cases non connected grid were not spotted)
  • [FIXED] now the observations once reloaded have the correct _is_done flag (obs._is_done = False)
    which allows to use the obs.get_energy_graph() for example. This fixes #538
  • [ADDED] now depends on the typing_extensions package
  • [ADDED] a complete test suite to help people develop new backend using "Test Driven Programming"
    techniques
  • [ADDED] the information on which time series data has been used by the environment in the inforeturn value
    of env.step(...)
  • [ADDED] a test suite easy to set up to test the backend API (and only the backend for now, integration tests with
    runner and environment will follow)
  • [ADDED] an attribute of the backend to specify which file extension can be processed by it. Environment creation will
    fail if none are found. See backend.supported_grid_format see #429
  • [IMPROVED] now easier than ever to run the grid2op test suite with a new backend (for relevant tests)
  • [IMPROVED] type hints for Backend and PandapowerBackend
  • [IMPROVED] distribute python 3.12 wheel
  • [IMPROVED] test for python 3.12 and numpy 1.26 when appropriate (eg when numpy version is released)
  • [IMPROVED] handling of environments without shunts
  • [IMPROVED] error messages when grid is not consistent
  • [IMPROVED] add the default l2rpn_case14_sandbox environment in all part of the docs (substituing rte_case14_realistic or nothing)
  • [IMPROVED] imports on the Exceptions module
  • [IMPROVED] pandapower backend raises BackendError when "diverging"

Release v1.9.5

18 Sep 13:59
Compare
Choose a tag to compare
  • [FIXED] issue #518
  • [FIXED] issue #446
  • [FIXED] issue #523 by having a "_BackendAction" folder instead of a file
  • [FIXED] issue #522 and adding back certain notebooks to the CI
  • [FIXED] an issue when disconnecting loads / generators on msot recent pandas version
  • [FIXED] issue #527 : now do nothing action are detected in
    act.as_serializable_dict() AND weird do nothing action can be made through the action space
    (env.action_space({"change_bus": {}}) is not ambiguous, though might not be super efficient...)

Release v1.9.4

04 Sep 14:30
Compare
Choose a tag to compare
  • [FIXED] read-the-docs template is not compatible with latest sphinx version (7.0.0)
    see readthedocs/sphinx_rtd_theme#1463
  • [FIXED] issue #511
  • [FIXED] issue #508
  • [ADDED] some classes that can be used to reproduce exactly what happened in a previously run environment
    see grid2op.Chronics.FromOneEpisodeData and grid2op.Opponent.FromEpisodeDataOpponent
    and grid2op.Chronics.FromMultiEpisodeData
  • [ADDED] An helper function to get the kwargs to disable the opponent (see grid2op.Opponent.get_kwargs_no_opponent())
  • [IMPROVED] doc of obs.to_dict and obs.to_json (see #509)

Release v1.9.3

28 Jul 14:30
Compare
Choose a tag to compare
  • [BREAKING] the "chronix2grid" dependency now points to chronix2grid and not to the right branch
    this might cause an issue if you install grid2op[chronix2grid] for the short term
  • [BREAKING] force key-word arguments in grid2op.make except for the first one (env name), see
    rte-france#503
  • [FIXED] a bug preventing to use storage units in "sim2real" environment (when the
    grid for forecast is not the same as the grid for the environment)
  • [ADDED] a CI to test package can be installed and loaded correctly on windows, macos and line_ex_to_sub_pos
    for python 3.8, 3.9, 3.10 and 3.11
  • [ADDED] possibility to change the "soft_overflow_threshold" in the parameters (like
    the "hard_overflow_threshold" but for delayed protections).
    See param.SOFT_OVERFLOW_THRESHOLD
  • [ADDED] the gym_env.observation_space.get_index(attr_nm) for BoxGymObsSpace that allows to retrieve which index
    of the observation represents which attribute.

Release v1.9.2

26 Jul 10:20
Compare
Choose a tag to compare
  • [BREAKING] rename with filename starting with lowercase all the files in the "Backend", "Action" and
    "Environment" modules. This is both consistent with python practice but allows also to make the
    difference between the files in the
    module and the class imported. This should have little to no impact on all codes but to "upgrade"
    instead of from grid2op.Action.BaseAction import BaseAction (which you should not have done in the first place)
    just do from grid2op.Action import BaseAction. Expect other changes like this for other grid2op modules
    in the near future.
  • [FIXED] broken environ "l2rpn_idf_2023" (with test=True) due to the presence of a __pycache__ folder
  • [FIXED] time series MultiFolder will now ignore folder __pycache__
  • [FIXED] an issue with compatibility with previous versions (due to alert)
  • [FIXED] an issue with the _ObsEnv when using reward that could not be used in forecast (self.is_simulated_env()
    was not working as expected due to a wrong init of the reward in _ObsEnv)
  • [FIXED] an issue when disconnecting loads / generators / storage units and changing their values in the same
    action: the behaviour could depend on the backend. As of 1.9.2 the "disconnections" have the priority (if
    an action disconnect an element, it will not change its sepoint at the same time).
  • [FIXED] a bug in AlertReward due to reset not being called.
  • [FIXED] issue #494
  • [ADDED] the score function used for the L2RPN 2023 competition (Paris Area)
  • [IMPROVED] overall performances by calling arr.sum() or arr.any() instead of np.sum(arr) or
    np.any(arr) see https://numpy.org/neps/nep-0018-array-function-protocol.html#performance
  • [IMPROVED] overall performance of obs.simulate function by improving speed of copy of _BackendAction
  • [IMPROVED] overall performance of env.step / obs.simulate by preventing unnecessary observation deep copy
  • [IMPROVED] overall performance of env.step / obs.simulate by switching to copy.deepcopy(obs) instead of
    obs.copy()

Release v1.9.1

06 Jul 08:36
Compare
Choose a tag to compare

Still lots of changes for this release (that should have been part of grid2op 1.9.0)

And some functionalities are still missing (and will be added shortly in version 1.9.2)

Breaking changes

  • 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.
  • 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
  • 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.
  • 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 issues

  • 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.
  • an issue with non renewable generators in GymActionSpace (some curtailment was made
    at 100% of their capacity instead of "no curtailment")
  • a bug in computing the datatype of BoxGymActSpace and BoxGymObsSpace leading to
    using "bool" as dtype when it should be int.
  • the behaviour of BoxGymActSpace when subtract / divide were provided (the dtype was
    not propagated correctly)

New features

  • 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)
  • the environment "l2rpn_idf_2023" (accessible via grid2op.make("l2rpn_idf_2023", test=True))
  • the RecoPowerlinePerArea that is able to reconnect multiple lines in different area in
    the same action
  • 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)
  • the method act.decompose_as_unary_actions(...) to automatically
    decompose a "complex" action on its unary counterpart.
  • 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)
  • the whole "alert" concept in grid2op with a grid2op environment supporting it (l2rpn_idf_2023)
  • the gym_env.action_space.get_index(attr_nm) for BoxGymActSpace that allows to retrieve which index
    of the action represents which attribute.
  • the argument quiet_warnings in the handlers to prevent the issue of too many warnings when using
    ForecastHandler

Improvements

  • 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))
  • 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)
  • error message when the "stat.clear_all()" function has been called on a statistic and this same
    statistic is reused.
  • possibility to set "other_rewards" in the config file of the env