Skip to content

Commit 73c1ee8

Browse files
committed
update Readme, changelog and notebook name [skip ci]
Signed-off-by: DONNOT Benjamin <[email protected]>
1 parent 09c4127 commit 73c1ee8

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Native multi agents support:
100100
- add detachment
101101
- add change_bus / set_bus
102102

103-
[1.11.0] - 202x-yy-zz
103+
[1.11.0] - 2025-04-14
104104
-----------------------
105105
- [BREAKING] Change for `FromMultiEpisodeData` that disables the caching by default
106106
when creating the data.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ interesting part of this framework:
202202
* [11_IntegrationWithExistingRLFrameworks](getting_started/11_IntegrationWithExistingRLFrameworks.ipynb)
203203
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Grid2Op/grid2op/blob/master/getting_started/11_IntegrationWithExistingRLFrameworks.ipynb)
204204
explains how to use grid2op with other reinforcement learning framework. TODO: this needs to be redone
205+
* [12_DetachmentOfLoadsAndGenerators.ipynb](getting_started/12_DetachmentOfLoadsAndGenerators.ipynb.ipynb)
206+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Grid2Op/grid2op/blob/master/getting_started/12_DetachmentOfLoadsAndGenerators.ipynb.ipynb)
207+
explains briefly what is detachment.
205208

206209
Try them out in your own browser without installing
207210
anything with the help of mybinder:

binder/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- pip
99
- pip:
1010
- grid2op
11-
- jyquickhelper
1211
- numpy
1312
- numba
1413
- seaborn

getting_started/13_DetachmentOfLoadsAndGenerators.ipynb renamed to getting_started/12_DetachmentOfLoadsAndGenerators.ipynb

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
"from pathlib import Path\n",
2424
"\n",
2525
"# Setup Environment\n",
26-
"data_path = Path.cwd() / \"grid2op\" / \"data\"\n",
27-
"p = Parameters()\n",
28-
"p.MAX_SUB_CHANGED = 5\n",
29-
"env = grid2op.make(data_path / \"rte_case5_example\", param=p, allow_detachment=True)\n",
26+
"env_standard = grid2op.make(\"rte_case5_example\", test=True, allow_detachment=False)\n",
27+
"env_with_detach = grid2op.make(\"rte_case5_example\", test=True, allow_detachment=True)\n",
3028
"\n",
3129
"# Setup Plotter Utility\n",
32-
"plotter = PlotMatplot(env.observation_space, load_name=True, gen_name=True, dpi=150)\n",
33-
"print(f\"Loads: {env.n_load}, Generators: {env.n_gen}, Storage: {env.n_storage}, Allow Detachment: {env._allow_detachment}\")"
30+
"plotter = PlotMatplot(env_standard.observation_space, load_name=True, gen_name=True, dpi=150)\n",
31+
"for env, env_name in zip([env_standard, env_with_detach], [\"env_standard\", \"env_with_detach\"]):\n",
32+
" print(f\"For {env_name}: Loads: {env.n_load}, Generators: {env.n_gen}, Storage: {env.n_storage}, Detachment is allowed: {env.detachment_is_allowed}\")"
3433
]
3534
},
3635
{
@@ -46,22 +45,33 @@
4645
"metadata": {},
4746
"outputs": [],
4847
"source": [
49-
"load_lookup = {name:i for i,name in enumerate(env.name_load)}\n",
50-
"gen_lookup = {name:i for i,name in enumerate(env.name_gen)}\n",
51-
"act = env.action_space({\"set_bus\":[(env.load_pos_topo_vect[load_lookup[\"load_3_1\"]], -1),\n",
52-
" (env.load_pos_topo_vect[load_lookup[\"load_4_2\"]], -1)]})\n",
48+
"act = env_standard.action_space({\"set_bus\":{\"loads_id\": [(\"load_3_1\", -1)]}})\n",
5349
"print(act)\n",
54-
"env.set_id(\"00\")\n",
55-
"init_obs = env.reset()\n",
56-
"obs, reward, done, info = env.step(act)\n",
50+
"init_obs = env_standard.reset(seed=0, options={\"time serie id\": \"00\"})\n",
51+
"obs, reward, done, info = env_standard.step(act)\n",
5752
"plotter.plot_obs(obs, figure=plt.figure(figsize=(8,5)))\n",
53+
"plt.title(\"Without providing 'allow_detachment=True' grid2op fails if a load is disconnected\")\n",
54+
"plt.show()"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": null,
60+
"metadata": {},
61+
"outputs": [],
62+
"source": [
63+
"init_obs = env_with_detach.reset(seed=0, options={\"time serie id\": \"00\"})\n",
64+
"obs, reward, done, info = env_with_detach.step(act)\n",
65+
"plotter.plot_obs(obs, figure=plt.figure(figsize=(8,5)))\n",
66+
"plt.title(\"Providing 'allow_detachment=True' grid2op continues if a load is disconnected\")\n",
67+
"plt.tight_layout()\n",
5868
"plt.show()"
5969
]
6070
}
6171
],
6272
"metadata": {
6373
"kernelspec": {
64-
"display_name": "venv_test",
74+
"display_name": "Python 3 (ipykernel)",
6575
"language": "python",
6676
"name": "python3"
6777
},
@@ -75,9 +85,9 @@
7585
"name": "python",
7686
"nbconvert_exporter": "python",
7787
"pygments_lexer": "ipython3",
78-
"version": "3.12.7"
88+
"version": "3.10.12"
7989
}
8090
},
8191
"nbformat": 4,
82-
"nbformat_minor": 2
92+
"nbformat_minor": 4
8393
}

0 commit comments

Comments
 (0)