PyPSA-CL — Long-Term Capacity Expansion Model of the Chilean National Electricity System
A long-term generation, storage and transmission capacity expansion model of Chile's National Electricity System (Sistema Eléctrico Nacional, SEN, 234 nodes), built on PyPSA. The model was developed for the Long-Term Energy Planning process (Planificación Energética de Largo Plazo, PELP 2028-2032).
The optimisation co-optimises investment and hourly operation across multiple representative periods, subject to system-level operating constraints (inertia, operating reserve), build-rate limits, CO₂ emission caps, unserved-energy limits and discrete transmission expansion. A detailed hydraulic network couples hydro generation to water balances, inflows and irrigation.
Repository layout
.
├── src/
│ └── pypsa_cl/ Python package
│ ├── main.py Entry point and epoch/scenario driver
│ ├── GUI.py Scenario and epoch configuration interface
│ ├── tools.py Data loaders, constraints and result exporters
│ ├── cli.py `pypsa-cl` command
│ └── assets/ GUI images
├── data/ Input workbooks (not tracked; see below)
├── outputs/ Model outputs (generated at run time)
├── pyproject.toml
├── CHANGELOG.md
├── LICENSE
└── README.md
Installation
The model requires Python 3.10 or newer (with Tk, which the standard Windows installer includes) and a mixed-integer linear programming solver supported by PyPSA. The open-source HiGHS solver is installed automatically and is the default; Gurobi (licence required), CPLEX and CBC can also be selected. The GUI is developed and tested on Windows.
From PyPI
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install pypsa-cl # with Gurobi: pip install "pypsa-cl[gurobi]"
pypsa-cl # downloads the input data on first run, then opens the GUI
From source
git clone https://github.com/paredes-vergara/PyPSA-CL.git
cd PyPSA-CL
pip install -e . # or: pip install -e ".[gurobi]"
Working folder
The model writes its results to an outputs/ folder inside a working folder.
The working folder is:
- the folder given by the
PYPSA_CL_ROOTenvironment variable, if set; - otherwise, the current directory if it contains
data/; - otherwise, the repository root when running from a source checkout;
- otherwise, the current directory.
my-pelp-run/
├── data/ Optional: your own copy of the input workbooks (see below)
└── outputs/ Created automatically
Input data
The model reads the following workbooks:
| File | Contents |
|---|---|
Topology.xlsx |
Buses, lines and generator/storage technical data |
Loads.xlsx |
Demand time series by node and scenario |
Profiles.xlsx |
Variable renewable and CSP availability profiles |
Costs.xlsx |
Fuel prices and generation/storage investment costs |
Hydraulic network.xlsx |
Water nodes, links and reservoirs |
Water time series.xlsx |
Inflow and irrigation series |
Policy levers.xlsx |
CO₂ tax, coal phase-out and expansion schedules |
These workbooks (about 245 MB) are too large for the PyPI package, so they are
published separately on Zenodo
(doi:10.5281/zenodo.24204230) and downloaded automatically the first time
the model runs. Each download is checked against its SHA-256 checksum. To
fetch them without starting the model, run pypsa-cl --download-data;
pypsa-cl --data-dir shows where they are stored.
The data folder is:
- the folder given by the
PYPSA_CL_DATA_DIRenvironment variable, if set; - otherwise, the
data/folder of the working folder, if it exists; - otherwise,
~/.pypsa-cl/data-v<data version>(shared by all working folders).
Workbooks already present in the data folder are used as they are and never
overwritten, so you can run the model with your own modified inputs by placing
all seven workbooks in data/. Only missing workbooks are downloaded. The
download source can be changed with the PYPSA_CL_DATA_URL environment variable
(a base URL under which the files are served by name).
The GUI header logo and network map ship with the package; files named
logo_PELP.png or sen_network.png placed in data/ take precedence.
Disclaimer: Although the data for CSP and hydro ROR candidate generators is present in the Topology file, these candidates were not implemented in this version due to time constraints. These candidates should be implemented in the Final Report version.
Usage
Interactive (GUI)
cd my-pelp-run # working folder: results go to my-pelp-run/outputs/
pypsa-cl # equivalent: python -m pypsa_cl
The interface lets you queue one or more global scenarios, each composed of
one or more investment epochs. Preset scenario packages (E1-N3)
auto-fill and lock the six component selectors (demand, climate, hydrology, fuel
price, generation investment cost, storage investment cost); the Otro option
unlocks free configuration. Scenarios can be executed sequentially or in
parallel (one independent process per scenario, with a configurable RAM limit).
Headless (single scenario)
A single scenario can be run without the GUI by supplying its configuration as JSON:
pypsa-cl --scenario-json path/to/scenario.json
Output location is controlled by the PYPSA_CL_OUTPUTS_DIR environment
variable; when unset, results are written under outputs/ in the working folder.
Run pypsa-cl --help for a summary of the command-line options.
Versioning
Releases follow the stages of the PELP 2028-2032 process: 0.1.x corresponds to
the Preliminary Report, 0.2.x to the Final Report and 1.0.0 to the Definitive
Report. See CHANGELOG.md.
Outputs
Each run writes the following CSV files to the output folder:
| File | Contents |
|---|---|
generation_results.csv |
Dispatch per asset and snapshot, with reserve, available and curtailment columns |
transmission_results.csv |
Flows per line and snapshot |
generation_expansion.csv |
Generation and storage expansion per epoch |
transmission_expansion.csv |
Transmission expansion per epoch |
installed_capacity.csv |
Installed capacity per epoch |
system_costs.csv |
System cost breakdown |
nodal_marginal_prices.csv |
Nodal marginal prices |
run_metadata_log.csv |
Parameters, solver settings and timings per epoch |
progress.json |
Live run status for monitoring |
In multi-scenario runs the outputs are concatenated into the same files, ordered
by scenario and identified by the global_scenario column.
Acknowledgements
Developed by the Unit of Planning and Climate Change (Unidad de Planificación y Cambio Climático), Division of Strategic Planning and Sustainable Development, Ministry of Energy of Chile.
License
Released under the MIT License. See LICENSE.
Metadata
Release files for pypsa-cl 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pypsa_cl-0.1.1.tar.gz | 181.3 kB | Without provenance | Details for pypsa_cl-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pypsa_cl-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pypsa_cl-0.1.1-py3-none-any.whl |
Total release size: 359.1 kB
Release files / pypsa_cl-0.1.1.tar.gz
| Download URL | pypsa_cl-0.1.1.tar.gz |
|---|---|
| Size | 181.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cebafc928e43292aff66ec48f9db401d9216343502651e455f92a640ceb525c5
|
|
BLAKE2b-256 checksum How to use checksums |
11266b3ae27c56a765f0137d0848a5dc9655182be75f25b2015eab53b60f1ea0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pypsa_cl-0.1.1-py3-none-any.whl
| Download URL | pypsa_cl-0.1.1-py3-none-any.whl |
|---|---|
| Size | 177.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44a1448a54b21f26e7fcb2a21852910ca60149019af39742003411ff94338c6c
|
|
BLAKE2b-256 checksum How to use checksums |
227db4545925fe4dbac046c58edfc38726d34522d913bd6580e9472cc052f8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pypsa-cl 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.