Published June 4, 2025 | Version v1
Model Open

Transformation pathways for a carbon-neutral electricity system in Kazakhstan - Model and data

  • 1. ROR icon Technische Universität Berlin
  • 2. Reiner-Lemoine-Institut

Description

#PyPSA Model Kazakhstan:
A simplified PyPSA power-system optimization model for the power sector of Kazakhstan.
This repository contains two Jupyter notebooks plus all input data, scenario outputs, sensitivity results and generated figures.
 
---
 
##Directory structure:
PyPSA Model Kazakhstan/
├── notebooks/                         # Jupyter notebooks
│   ├── 01_main.ipynb                  # data loading, model building and optimization
│   └── 02_results.ipynb               # post-processing & plotting
├── Input Data/                        # raw input tables, shapefiles, etc.
├── Scenario Analysis Results/         # optimized .nc network snapshots (baseline & scenarios)
├── Sensitivity Analysis Results/      # optimized .nc snapshots for sensitivity runs
└── Generated Illustrations/           # all generated illustrations
 
---
 
##Requirements:
Python 3.8+
Install dependencies via conda or pip:
using conda
conda create -n pypsa-kaz python=3.10  
conda activate pypsa-kaz  
conda install -c conda-forge pypsa pandas xarray geopandas cartopy matplotlib seaborn openpyxl linopy pyomo 
or with pip
python -m venv venv  
source venv/bin/activate  
pip install pypsa pandas xarray geopandas cartopy matplotlib seaborn openpyxl linopy pyomo  
 
---
 
##Configuration:
At the top of each notebook we use a single “path cell” to locate your project root automatically:
from pathlib import Path
####Option A: climb until “Input Data” is found
BASE_DIR = Path.cwd()
while not (BASE_DIR / "Input Data").exists() and BASE_DIR.parent != BASE_DIR:
    BASE_DIR = BASE_DIR.parent
#### Option B: hard-code once if you prefer
##### BASE_DIR = Path(r"/mnt/tubcloud/MA_Carsten_Jan_384133/PyPSA Model Kazakhstan")
INPUT_DIR       = BASE_DIR / "Input Data"
SCENARIO_DIR    = BASE_DIR / "Scenario Analysis Results"
SENSITIVITY_DIR = BASE_DIR / "Sensitivity Analysis Results"
FIG_DIR         = BASE_DIR / "Generated Illustrations"
 
---
 
##Usage:
Sync or download the entire PyPSA Model Kazakhstan folder (e.g. via tubcloud).
Open a terminal in that folder.
Activate your conda/env (see Requirements).
Launch Jupyterlab
In _main.ipynb:
Make sure to select the SOLVER of preference in order to undertake optimizations (for additional infos see: https://pypsa.readthedocs.io/en/latest/getting-started/installation.html)
NOTE: All computed results of pathways and sensitivity are availabe in folder. NO OPTIMIZATIONS needed in order to inspect results in _results_ notebook!
All cells cells containing optimization calls are currently commented out or marked as 'raw'. In order to undertake optimizations switch on (one computation should take about 10 min to 3 hours).
Optimization works sequential: Meaning that one timestep (e.g. 2030) per scenario (or sensitivity) is computed at the time. This is to avoid long computation times with limited computing power.
Swith respective cells to markdown. Pathway cells subsequently build on one another, therefore make sure to compute previous stage (or use the custom function 'load_netcdf' function to load).
In _results.ipynb: 
run all cells to load those .nc files, compute metrics, and save figures & CSV summaries into Generated Illustrations/.
Not all illustrations used in written thesis. Some are only for better understanding of results.
Sources of Input Data folder can be obtained from written thesis.
 
---
 
##Contact Author:
Jan Carsten
jan.carsten@gmx.de
 
---

 

Files

PyPSA Model Kazakhstan.zip

Files (348.4 MB)

Name Size Download all
md5:146d8c1f5b8a1c2f264f86f460b0a7d2
348.4 MB Preview Download

Additional details

Dates

Submitted
2025-06-04

Software

Programming language
Python
Development Status
Active