Skip to content

Releases: Grid2op/grid2op

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

Version 1.9.0

06 Jun 11:45
Compare
Choose a tag to compare

Breaking changes

  • (because prone to bug): force the environment name in the grid2op.make function.
  • 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.
  • the "maintenance_forecast" file is deprecated and is no longer used (this should not
    not impact anything)
  • 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.
  • the function "obs.as_networkx" will be renamed "obs.get_energy_graph" and the
    description has been adapted.
  • In PandaPowerBackend the kwargs argument "ligthsim2grid" was misspelled and is now properly
    renamed lightsim2grid
  • you can no longer use the env.reactivate_forecast() in the middle of an episode.
  • the method runner.run_one_episode() (that should not use !) now
    returns also the total number of steps of the environment.

Fixed issues

  • a bug in PandapowerBackend when running in dc mode (voltages were not read correctly
    from the generators)

  • issue #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
  • the N1Reward that was broken

  • the act._check_for_ambiguity: a case where missing (when you used topology to disconnect a powerline,
    but also set_bus to connect it)

  • a bug when the storage unit names where not set in the backend and needed to be set
    automatically (wrong names were used)

  • a bug in PandaPowerBackend when using BackendConverter and one the backend do not support shunts.

  • 2 issues related to gym env: #407 and
    #418

  • some bus in the obs.get_energy_graph (previously obs.as_networkx()) for the cooldowns of substation

  • issue #396

  • issue #403

  • a bug in PandaPowerBackend when it was copied (the kwargs used to build it were not propagated)

  • a bug in the Runner when the time series class used is not MultiFolder (eg GridStateFromFile): we could
    not run twice the same environment.

  • a bug n the GridStateFromFile, GridStateFromFileWithForecasts and
    GridStateFromFileWithForecastsWithoutMaintenance classes that caused the maintenance file to be
    ignored when "chunk_size" was set.

  • a bug when shunts were alone in backend.check_kirchoff()

  • an issue with "max_iter" in the runner when MultifolderWithCache
    (see issue #447)

  • a bug in MultifolderWithCache when seeding was applied

New features

  • 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.
  • an example on how to write a backend.
  • 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]
  • a step by step (very detailed) example on how to build a Backend from an existing grid "solver".
  • some test when the shunt bus are modified.
  • a function to get the "elements graph" from the grid2op observation (represented as a networkx graph)
    as well as its description on the documentation.
  • a method to retrieve the "elements graph" (see doc) fom an observation obs.get_elements_graph()
  • a whole new way to deal with input time series data (see the module grid2op.Chronics.handlers
    for more information)
  • possibility to change the parameters used for the obs.simulate(...)
    directly from the grid2op action, see obs.change_forecast_parameters()
  • possibility to retrieve a "forecast environment" with custom forecasts, see
    obs.get_env_from_external_forecasts(...)
  • now requires "importlib-metadata" package at install
  • 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.
  • Runner is now able to store if an action is legal or ambiguous
  • experimental support to count the number of "high resolution simulator" (obs.simulate,
    obs.get_simulator and obs.get_forecast_env) in the environment (see
    #417). It might not work properly in distributed settings
    (if the agents uses parrallel processing or if MultiProcessEnv is used), in MultiMixEnv, etc.
  • it now possible to check the some rules based on the definition of
    areas on the grid.

Improvments

  • possibility to "chain" the call to simulate when multiple forecast
    horizon are available.
  • the GridStateFromFileWithForecasts is now able to read forecast from multiple steps
    ahead (provided that it knows the horizons in its constructor)
  • documentation of the gym DiscreteActSpace: it is now explicit that the "do nothing" action
    is by default encoded by 0
  • documentation of BaseObservation and its attributes
  • PandapowerBackend can now be loaded even if the underlying grid does not converge in AC (but
    it should still converge in DC) see #391
  • obs.get_energy_graph (previously obs.as_networkx()) method:
    almost all powerlines attributes can now be read from the
    resulting graph object.
  • possibility to set data_feeding_kwargs from the config file directly.
  • so "FutureWarnings" are silenced (depending on pandas and pandapower version)
  • error messages when "env.reset()" has not been called and some functions are not available.
  • 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)
  • 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).
  • 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)
  • 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.
  • 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.
  • 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)
  • the doc of the obs.get_energy_graph (previously obs.as_networkx())
  • it is now possible to use a different backend, a different grid or different kwargs between the
    env backend and the obs backend.
  • the environment now called the "chronics_handler.forecast" function at most once per step.
  • make it easier to create an environment without MultiFolder or MultifolderWithCache
  • add the possibility to forward kwargs to chronix2grid function when calling env.generate_data
  • when calling env.generate_data an extra file (json) will be read to set default values
    passed to chronix2grid.add_data
  • 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.
  • possibility to pass game rules by instance of object and not by class.

Release v1.8.1

11 Jan 13:01
Compare
Choose a tag to compare

Fixed issues

  • a deprecation with numpy>= 1.24 (eg np.bool and np.str), related to #393

Additions

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

Improvments

  • improved error messages in pandapower backend when the grid do not converge due to disconnected generators or loads.

Version 1.8.0

12 Dec 09:36
Compare
Choose a tag to compare

Breaking changes

  • now requires numpy >= 1.20 to work (otherwise there are
    issues with newer versions of pandas).
  • issue #379 requires
    different behaviour depending on installed gym package.
  • 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 #148

Fixed issues

  • a bug when using a Runner with an environment that has
    been copied (see #361)
  • issue #358
  • issue #363
  • issue #364
  • issue #365 and
    #376 . Now the function(s)
    gridobj.process_shunt_data and gridobj.process_grid2op_shunt_data are called
    gridobj.process_shunt_static_data
  • issue #367
  • issue #369
  • issue #374
  • issue #377 by adding a special
    method backend.update_thermal_limit_from_vect

Addition

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

Improvement

  • clarify documentation of gym compat module (see
    #372 and
    #373) as well as the doc
    for MultifolderWithCache (see #370)

Release 1.7.2

05 Jul 13:48
7bf2774
Compare
Choose a tag to compare

[1.7.2] - 2022-07-05

  • [FIXED] seeding issue #331
  • [FIXED] clarify doc about fixed size matrices / graphs #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 #340)
  • [FIXED] an issue with act0 + act1 when curtailment was applied
    (see #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

Release 1.7.1

03 Jun 11:41
974fa08
Compare
Choose a tag to compare

This release will most likely be the grid2op version used for the l2rpn 2022 competition at WCCI conference.

Breaking changes

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

  • a documentation issue #281
  • a bug preventing to use the FromChronix2grid chronics class when
    there is an opponent on the grid.
  • a documentation issue #319
    on notebook 11
  • 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
  • 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
  • an issue when converting a "done" action as a graph, see
    #327

New features

  • score function for the L2RPN WCCI 2022 competition

Improvments

  • adding the compatibility with logger in the reward functions.
  • 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)
  • it is now possible to make an environment with a backend that
    cannot be copied.
  • 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.
  • description and definition of obs.curtailment_limit_effective are now
    consistent (issue #321)

Release 1.7.0

29 Apr 12:02
55493b6
Compare
Choose a tag to compare

This release introduces some new functionalities, such as the compatibility to generate data "on the fly" or add more data to an environment.

It also adds some useful features for the curtailment and storage units (some new attributes of the observation) and a first version of the environment used for l2rpn WCCI 2022 competition.

Python 3.6 support has been dropped.

Breaking changes

  • the L2RPNSandBoxScore, RedispReward and EconomicReward now properly computes the cost of the grid
    (there was an error between the conversion from MWh - cost is given in $ / MWh - and MW). This impacts also ScoreICAPS2021 and ScoreL2RPN2020.
  • in the "gym_compat" module the curtailment action type has
    for dimension the number of dispatchable generators (as opposed to all generators
    before) this was mandatory to fix issue #282
  • the size of the continuous action space for the redispatching in
    case of gym compatibility has also been adjusted to be consistent with curtailment.
    Before it has the size of env.n_gen now np.sum(env.gen_redispatchable).
  • move the _ObsEnv module to Environment (was before in Observation).
  • adding the curtailment_limit_effective in the observation converted to gym. This changes
    the sizes of the gym observation.
  • officially drop python 3.6 supports (which could not benefit from all the features)

Fixed issues

  • a bug preventing to use backend.update_from_obs when there are shunts on the grid for PandapowerBackend
  • a bug in the gym action space: see issue #281
  • a bug in the gym box action space: see issue #283
  • a bug when using MultifolderWithCache and Runner (see issue #285)
  • a bug in the env.train_val_split_random where sometimes some wrong chronics
    name were sampled.
  • the max value of the observation space is now 1.3 * pmax to account for the slack bus (it was
    1.01 of pmax before and was not sufficient in some cases)
  • a proper exception is added to the "except" kwargs of the "info" return argument of env.step(...)
    (previously it was only a string) when redispatching was illegal.
  • a bug in env.train_val_split_random when some non chronics files where present in the
    "chronics" folder of the environment.
  • an error in the redispatching: in some cases, the environment detected that the redispatching was infeasible when it
    was not and in some others it did not detect when it while it was infeasible. This was mainly the case
    when curtailment and storage units were heavily modified.
  • now possible to create an environment with the FromNPY chronixcs even if the "chronics" folder is absent.
  • a bug preventing to converte observation as networkx graph with oldest version of numpy and newest version of scipy.
  • a bug when using max_iter and Runner in case of max_iter being larger than the number of steps in the
    environment and nb_episode >= 2.
  • a bug in the hashing of environment in case of storage units (the characteristics of the storage units
    were not taken into account in the hash).
  • a bug in the obs.as_dict() method.
  • a bug in when using the "env.generate_classe()" #310
  • another bug in when using the "env.generate_classe()" on windows #311

New features

  • a function normalize_attr allowing to easily scale some data for the
    BoxGymObsSpace and BoxGymActSpace
  • support for distributed slack in pandapower (if supported)
  • an attribute self.infos for the BaseEnv that contains the "info" return value of env.step(...)
  • the possibility to shuffle the chronics of a GymEnv (the default behavior is now to shuffle them)
  • two attribtues for the observation: obs.gen_margin_up and obs.gen_margin_down
  • support for hashing chronix2grid related components.
  • possibility to change the type of the opponent space type from the make(...) command
  • a method to "limit the curtailment / storage" action depending on the availability of controllable generators
    (see act.limit_curtail_storage(...))
  • a class to generate data "on the fly" using chronix2grid (for now really slow and only available for
    a single environment)
  • a first version (for testing only) for the l2rpn_wcci_2022 environment.
  • a method to compute the "simple" line reconnection actions (adding 2 actions per lines instead of 5)
    in the action space (see act_space.get_all_unitary_line_set_simple())

Improvements

  • better difference between env_path and grid_path in environments.
  • addition of a flag to control whether pandapower can use lightsim2grid (to solve the powerflows) or not
  • clean the warnings issued by pandas when used with pandapower
  • doc of observation module (some attributes were missing)
  • add support for setting the maximum number of iteration in the PandaPowerBackend
  • when the curtailment / storage is too "strong" at a given step, the environment will now allow
    every controllable turned-on generators to mitigate it. This should increase the possibility to act on the
    curtailment and storage units without "breaking" the environment.
  • have dedicated type of actions / observation for L2RPN competition environments,
    defined in the "conf.py" file (to make possible the use of different
    grid2op version transparently)
  • on some cases, the routine used to compute the redispatching would lead to a "redispatch" that would
    change even if you don't apply any, for no obvious reasons. This has been addressed, though it's not perfect.
  • finer resolution when measuring execution times