PLEXOS-to-PyPSA Converter
Project description
PLEXOS-to-PyPSA Converter
Convert PLEXOS input models to PyPSA networks for optimization and analysis.
This tool converts PLEXOS input XML files and their associated data into PyPSA networks that you can solve, analyze, and visualize.
Key Features
- Automated workflow - One-line conversion from PLEXOS XML to solved PyPSA network
- Flexible demand strategies - Per-node, aggregate, or target node assignment
- Rich analysis tools - Built-in
NetworkAnalyzerwith generation, capacity, and energy balance plots - Interactive notebooks - Example Jupyter notebooks
Requirements
- Python: 3.11 or 3.12
- PyPSA: Version <1.0 (specifically >=0.34, <1.0)
Installation
Install from PyPI
pip install plexos-to-pypsa-converter
Development Install
git clone https://github.com/open-energy-transition/plexos-to-pypsa-converter.git
cd plexos-to-pypsa-converter
pip install -e .
Optional: System Dependencies
Some models use RAR archives and require unrar:
# macOS
brew install rar
This is only needed for RAR-based models like plexos-world-spatial.
Usage
Once installed (whether from PyPI or this repository), the converter is
available as the plexos_to_pypsa_converter package. You can call it from any
location.
Quick Start with Example Models
The easiest way to get started is with the high-level workflow API:
from plexos_to_pypsa_converter.workflow import run_model_workflow
# Run the workflow: download → convert → save
network, setup_summary = run_model_workflow("caiso-irp23")
# Solve a specific year (multi-period models)
network, setup_summary = run_model_workflow(
"aemo-2024-isp-progressive-change",
solve=True,
optimize__year=2025
)
# Also add the solve/optimize step
network, setup_summary = run_model_workflow("caiso-irp23", solve=True)
By running `run_model_workflow(), this automatically:
- Downloads the model data (if the data does not exist locally)
- Converts PLEXOS XML to CSV files (using
plexos-coad) - Creates the PyPSA network with topology/components
- Adds other features, such as renewable profiles, retirements, generator outages, and slack generators
- Optionally solves the optimization problem (when
solve=True) - Saves results to NetCDF format
Interactive Notebooks
For interactive analysis and visualization, check out the example notebooks:
You can view a version of the results analysis for the caiso-irp23 model here.
The current existing notebooks are:
-
CAISO IRP23:
src/plexos_to_pypsa_converter/examples/caiso_irp23/caiso_solve.ipynb(to convert and solve thecaiso-irp23model)src/plexos_to_pypsa_converter/examples/caiso_irp23/caiso_analysis.ipynb(to visualize thecaiso-irp23model's results after solving)
-
AEMO 2024 Progressive Change:
src/plexos_to_pypsa_converter/examples/aemo_2024_prog/aemo_solve.ipynb(to convert and solve theaemo-2024-isp-progressive-changemodel)src/plexos_to_pypsa_converter/examples/aemo_2024_prog/aemo_analysis.ipynb(to visualize theaemo-2024-isp-progressive-changemodel's results after solving)
These notebooks show how to:
- Convert and solve PLEXOS models
- Generate network statistics
- Create plots for simple analysis and validation
- Export results for further analysis
Note that you have to run the {}_solve.ipynb notebooks before you are able to run the {}_analysis.ipynb notebooks.
Advanced: Custom Workflows
The default workflow steps for each model is specified in src/db/registry.py.
However, you can customize the workflow steps to skip some steps. For example, to skip saving the network and to save under a custom filename:
from plexos_to_pypsa_converter.db.registry import MODEL_REGISTRY
from plexos_to_pypsa_converter.workflow import run_model_workflow
# Modify workflow (e.g., skip automatic save)
default_workflow = MODEL_REGISTRY["caiso-irp23"]["processing_workflow"]
custom_workflow = default_workflow.copy()
custom_workflow["steps"] = [
step for step in default_workflow["steps"]
if step["name"] != "save_network"
]
# Run with custom workflow
network, setup_summary = run_model_workflow(
"caiso-irp23",
workflow_overrides=custom_workflow,
demand_assignment_strategy="aggregate_node"
)
# Save with custom filename
network.export_to_netcdf("my_custom_output.nc")
Supported Models
The following PLEXOS models are supported or in development:
| Model Name | Source | Status | Download |
|---|---|---|---|
| AEMO 2024 ISP - Green Energy Exports | AEMO | 🔴 Not yet converted | Download |
| AEMO 2024 ISP - Progressive Change | AEMO | 🟡 In-progress | Download |
| AEMO 2024 ISP - Step Change | AEMO | 🔴 Not yet converted | Download |
| CAISO IRP 2023 Stochastic (25 MMT) | CAISO | 🟡 In-progress | Download |
| CAISO 2025 Summer Assessment | CAISO | 🔴 Not yet converted | Download |
| NREL Extended IEEE 118-bus | NREL | 🔴 Not yet converted | Download |
| SEM 2024-2032 Validation Model | SEM | 🟡 In-progress | Download |
| European Power & Gas Model | UCC | 🟡 In-progress | Download |
| PLEXOS-World 2015 Gold V1.1 | UCC | 🔴 Not yet converted | Download |
| PLEXOS-World Spatial Resolution | UCC | 🔴 Not yet converted | Download |
| MESSAGEix-GLOBIOM-EN-NPi2020-500-Soft-Link | UCC | 🟡 In-progress | Download |
Status Legend:
- 🟢 Converted - Model successfully converted to PyPSA network
- 🟡 In-progress - Conversion currently underway
- 🔴 Not yet converted - Planned for future conversion
Model × Feature Coverage
The heatmap shows conversion status of different features across all models.
What Gets Converted
The converter handles these PLEXOS components:
Core Components:
- Buses/nodes and network topology
- Generators (thermal, hydro, renewables)
- Loads with flexible assignment strategies
- Transmission lines and links
- Storage units (batteries, pumped hydro)
Advanced Features:
- Forced retirements and capacity additions
- Generator outages and maintenance schedules
Architecture
The converter uses a CSV-based approach to take the PLEXOS model properties and turn them into PyPSA networks:
- Download - Automatically fetch model data from source URLs
- CSV Export - Convert PLEXOS XML to structured CSV files using COAD
- Network Creation - Build PyPSA network from CSV data; Add outages, add slack generators, validate constraints
- Optimization - Solve using PyPSA's optimization
- Analysis - Generate plots and statistics with NetworkAnalyzer
Contribute
Report bugs on GitHub Issues.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plexos_to_pypsa_converter-0.1.0.tar.gz.
File metadata
- Download URL: plexos_to_pypsa_converter-0.1.0.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6463b5bf43869ea9717ad1b7a9cee6a01827e6955f3a3017654fcafa4f715134
|
|
| MD5 |
6884e832652c1c858ed9cb926f797c46
|
|
| BLAKE2b-256 |
a86efeaed9aab83f1f1f2393a4adc2489e6963c9f67c72866165d0cbb7602098
|
File details
Details for the file plexos_to_pypsa_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: plexos_to_pypsa_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 949.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
318f1320e3e1192f83565e777a0b54c6f596417241c192dcc1204e74618babaa
|
|
| MD5 |
ea8e9f33f592ac1109ee9f95c5d8e62c
|
|
| BLAKE2b-256 |
b27fef53d2d53863007fc0bf3f7d078fbe1ecb0be26030c2cfc931b7d53b80d3
|