This project provides a workflow to generate chronics for both the ai4realnet_large and ai4realnet_small environments.
The process is divided into two main steps:
Generate realistic power grid scenarios for the large environment (118 substations) using chronix2grid.
python3 step1_generate_large.py --weeks 1 --scenarios 1 --start_date 2035-01-01This will create scenarios in ai4realnet_large/chronics/.
Extract the subgrid data for the small environment (36 substations). This script simulates the large grid and calculates boundary flows to populate interconnection loads setpoints.
python3 step2_generate_small.pyThis automatically populates ai4realnet_small/chronics/.
To ensure you have exactly the right versions and a clean environment, use the provided pyproject.toml and uv (a fast Python package manager).
# 1. Install uv if you don't have it (see https://github.com/astral-sh/uv)
# 2. Sync the environment (creates .venv and installs dependencies)
uv sync
# 3. Activate the environment
source .venv/bin/activateThe derivation from large to small grid uses a mapping methodology where boundary lines are converted into "virtual loads".
👉 Read METHODOLOGY.md for full technical details.
ai4realnet_large: 118 substations (based on L2RPN IDF 2023).ai4realnet_small: 36 substations (subgrid ofai4realnet_large).
Note that the ai4realnet_small environment was previously based on l2rpn_icaps_2021. Both environments are now based on l2rpn_idf_2023 (see https://grid2op.readthedocs.io/en/latest/available_envs.html for more details).
The workflow can also be used to generate chronics for custom environments following the same structure.
For example, ai4realnet_large_shift is a shifted environment with modified generator characteristics (see prods_characs.csv).
1. Generate chronics for a custom large environment:
python3 step1_generate_large.py --env ai4realnet_large_shift --weeks 1 --scenarios 12. Derive small grid chronics from the custom large environment:
python3 step2_generate_small.py --large_env ai4realnet_large_shift --small_env ai4realnet_small_shiftNote that the custom environments must be created before using the scripts, which only generate the respective chronics.