Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/check-precommit-applied.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:

steps:
# Checkout full repo history to ensure diff calculation works
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: '3.12'

# Cache pre-commit environments
- name: Cache pre-commit hooks
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0 # Fetch all history for mike to work properly

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:

# If no specific notes found, use a default message
if [ ! -s release_notes.md ]; then
echo "Release $VERSION of PyPSA-China (PIK)" > release_notes.md
echo "Release $VERSION of PyPSA-China" > release_notes.md
echo "" >> release_notes.md
echo "For detailed changes, see the [CHANGELOG](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)." >> release_notes.md
fi
Expand All @@ -60,7 +60,7 @@ jobs:
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: PyPSA-China PIK ${{ steps.get_version.outputs.VERSION }}
name: PyPSA-China ${{ steps.get_version.outputs.VERSION }}
body_path: release_notes.md
draft: false
prerelease: false
Expand Down Expand Up @@ -121,4 +121,4 @@ jobs:
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
echo "📚 Documentation for version $VERSION has been deployed to GitHub Pages"
echo "View at: https://pik-piam.github.io/PyPSA-China-PIK/"
echo "View at: https://pypsa.github.io/PyPSA-China/"
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
# Step 1: Checkout the repository
- uses: actions/checkout@v4
- uses: actions/checkout@v7

# Step 2: Install Miniforge (no env creation here)
- name: Setup Miniforge
Expand All @@ -34,7 +34,7 @@ jobs:
# Step 3: Restore full Conda environment cache AFTER setup
- name: Restore Conda env cache
id: env-cache
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
/home/runner/miniforge3/envs/pypsa-china
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand All @@ -50,7 +50,7 @@ jobs:

- name: Upload build artifacts
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: docs-build-output
path: site/
Expand All @@ -67,7 +67,7 @@ jobs:

- name: Upload build artifacts
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: failed-build
path: site/
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Official release preparation with versioned documentation
- Comprehensive documentation at https://pik-piam.github.io/PyPSA-China-PIK/
- Comprehensive documentation at https://pypsa.github.io/PyPSA-China/
- MkDocs-based documentation with Material theme
- Support for versioned documentation using mike
- GitHub Actions workflow for automated documentation deployment
Expand Down Expand Up @@ -54,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Multiple enhancements to the modeling workflow
- Improved data handling and processing

## [1.0.x] - Initial PIK Releases
## [1.0.x] - Initial Release

### Added
- Initial PIK adaptation of PyPSA-China
Expand All @@ -68,10 +68,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Version History Notes

PyPSA-China (PIK) is based on the paper by Zhou et al, which extends a version original developed by Hailiang Liu et al. This changelog tracks changes from version 1.0.0 onwards in the PIK implementation.
PyPSA-China is based on the paper by Zhou et al, which extends a version original developed by Hailiang Liu et al. This changelog tracks changes from version 1.0.0 onwards in the re-implementation.

For detailed information about specific changes, see the [commit history](https://github.com/pik-piam/PyPSA-China-PIK/commits/main) on GitHub.
For detailed information about specific changes, see the [commit history](https://github.com/pypsa/PyPSA-China/commits/main) on GitHub.

[Unreleased]: https://github.com/pik-piam/PyPSA-China-PIK/compare/v1.3.0...HEAD
[1.3.0]: https://github.com/pik-piam/PyPSA-China-PIK/releases/tag/v1.3.0
[1.2.0]: https://github.com/pik-piam/PyPSA-China-PIK/releases/tag/v1.2.0
[Unreleased]: https://github.com/pypsa/PyPSA-China/compare/v1.3.0...HEAD
[1.3.0]: https://github.com/pypsa/PyPSA-China/releases/tag/v1.3.0
[1.2.0]: https://github.com/pypsa/PyPSA-China/releases/tag/v1.2.0
17 changes: 10 additions & 7 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "PyPSA-China (PIK): An Open-Source Optimisation Model of the Chinese Energy System"
title: "PyPSA-China: An Open-Source Optimisation Model of the Chinese Energy System"
authors:
- name: "PIK RD3-ETL Team"
- name: "PIK Energy Transition Lab"
affiliation: "Potsdam Institute for Climate Impact Research (PIK)"
repository-code: "https://github.com/pik-piam/PyPSA-China-PIK"
url: "https://pik-piam.github.io/PyPSA-China-PIK/"
- name: Xiaowei Zhou
affiliation: "Technische Universität Berlin, Germany"
- name: Hailiang Liu
affiliation: ""
repository-code: "https://github.com/pypsa/PyPSA-China"
url: "https://pypsa.github.io/PyPSA-China/"
license: MIT (code - data may differ)
version: 1.3.2
date-released: 2025-12-02
Expand All @@ -19,12 +23,11 @@ keywords:
- capacity expansion
- PyPSA
abstract: >
PyPSA-China (PIK) is an open-source model of the Chinese energy system
PyPSA-China is an open-source model of the Chinese energy system
covering electricity and heat. It co-optimizes dispatch and investments
under user-set constraints, such as limits to environmental impacts, to
minimize costs. The model works at provincial resolution and can simulate
a full year at hourly resolution. This is the PIK implementation, adapted
for coupling with the REMIND integrated assessment model.
a full year at hourly resolution.
references:
- type: article
title: "The role of hydro power, storage and transmission in the decarbonization of the Chinese power system"
Expand Down
10 changes: 5 additions & 5 deletions CITATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

## How to Cite

If you use PyPSA-China (PIK) in your research, please cite:
If you use PyPSA-China in your research, please cite:

### Software Citation

```bibtex
@software{pypsa_china_pik,
author = {{PIK RD3-ETL Team}},
title = {PyPSA-China (PIK): An Open-Source Optimisation Model of the Chinese Energy System},
@software{pypsa_china,
author = {{PIK RD3-ETL Team, Zhou, Xiaowei}},
title = {PyPSA-China: An Open-Source Optimisation Model of the Chinese Energy System},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/pik-piam/PyPSA-China-PIK},
url = {https://github.com/pypsa/PyPSA-China},
version = {1.3.2,
doi = {10.5281/zenodo.XXXXXXX} % Add Zenodo DOI when available
}
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to PyPSA-China (PIK)
# Contributing to PyPSA-China

Thank you for your interest in contributing to PyPSA-China (PIK)! This document provides guidelines and instructions for contributing to the project.
Thank you for your interest in contributing to PyPSA-China! This document provides guidelines and instructions for contributing to the project.

## Table of Contents

Expand All @@ -18,10 +18,10 @@ Thank you for your interest in contributing to PyPSA-China (PIK)! This document
1. **Fork the repository** on GitHub
2. **Clone your fork** locally:
```bash
git clone https://github.com/your-username/PyPSA-China-PIK.git
cd PyPSA-China-PIK
git clone https://github.com/your-username/PyPSA-China.git
cd PyPSA-China
```
3. **Set up the development environment** following the [installation guide](https://pik-piam.github.io/PyPSA-China-PIK/installation/quick_start/)
3. **Set up the development environment** following the [installation guide](https://pypsa.github.io/PyPSA-China/installation/quick_start/)
4. **Create a branch** for your changes:
```bash
git checkout -b feature/your-feature-name
Expand Down Expand Up @@ -279,14 +279,14 @@ Releases are managed by project maintainers:

## Questions?

- Check the [documentation](https://pik-piam.github.io/PyPSA-China-PIK/)
- Open a [discussion](https://github.com/pik-piam/PyPSA-China-PIK/discussions)
- Check the [documentation](https://pypsa.github.io/PyPSA-China/)
- Open a [discussion](https://github.com/pypsa/PyPSA-China/discussions)
- Contact the maintainers via GitHub issues

## License

By contributing to PyPSA-China (PIK), you agree that your contributions will be licensed under the [MIT License](LICENSES/MIT.txt).
By contributing to PyPSA-China, you agree that your contributions will be licensed under the [MIT License](LICENSES/MIT.txt).

---

Thank you for contributing to PyPSA-China (PIK)! 🎉
Thank you for contributing to PyPSA-China! 🎉
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# PyPSA-China:An Open-Source Optimisation model of the Chinese Energy System

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://pik-piam.github.io/PyPSA-China-PIK/)
[![GitHub release](https://img.shields.io/github/v/release/pik-piam/PyPSA-China-PIK)](https://github.com/pik-piam/PyPSA-China-PIK/releases)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://pypsa.github.io/PyPSA-China/)
[![GitHub release](https://img.shields.io/github/v/release/pypsa/PyPSA-China)](https://github.com/pypsa/PyPSA-China/releases)

PyPSA-China (PIK) is a open-source model of the Chinese energy system covering electricity and heat. It co-optimizes dispatch and investments under user-set constraints, such as limits to environmental impacts, to minimize costs. The model works at provincial resolution and can simulate a full year at hourly resolution.
PyPSA-China is a open-source model of the Chinese energy system covering electricity and heat. It co-optimizes dispatch and investments under user-set constraints, such as limits to environmental impacts, to minimize costs. The model works at provincial resolution and can simulate a full year at hourly resolution.

## PIK version
This is the PIK implementation of the PyPSA-China power model, first published by Hailiang Liu et al for their study of [hydro-power in china](https://doi.org/10.1016/j.apenergy.2019.02.009) and extended by Xiaowei Zhou et al for their ["Multi-energy system horizon planning: Early decarbonisation in China avoids stranded assets"](doi.org/10.1049/ein2.12011) paper. It is adapted from the Zhou version by the [PIK RD3-ETL team](https://www.pik-potsdam.de/en/institute/labs/energy-transition/energy-transition-lab), with the aim of coupling it to the [REMIND](https://www.pik-potsdam.de/en/institute/departments/transformation-pathways/models/remind) integrated assessment model. A reference guide is available as part of the [documentation](https://pik-piam.github.io/PyPSA-China-PIK/).
The PyPSA-China power model, was first developed by H Liu et al for their study of [hydro-power in china](https://doi.org/10.1016/j.apenergy.2019.02.009) and then extended and released by X Zhou et al for their ["Multi-energy system horizon planning: Early decarbonisation in China avoids stranded assets"](doi.org/10.1049/ein2.12011) paper. The current version has been heavily reworked and is currently maintained by the [Potsdam Institute for Climate Impact Studies ETL team](https://www.pik-potsdam.de/en/institute/labs/energy-transition/energy-transition-lab).

## Overview
PyPSA-China should be understood as a modelling worklow, using snakemake as workflow manager, around the [PyPSA python power system analysis](https://pypsa.org/) package. The workflow collects data, builds the power system network and plots the results. It is akin to its more mature sister project, [PyPSA-EUR](https://github.com/PyPSA/pypsa-eur), from which it is derived.
PyPSA-China should be understood as a modelling worklow, using snakemake as workflow manager, around the [PyPSA python power system analysis](https://pypsa.org/) package. The workflow collects data, builds the power system network and plots the results. It is akin to its more mature sibbling, [PyPSA-EUR](https://github.com/PyPSA/pypsa-eur), from which it is derived.

Unlike PyPSA-EUR, which simplifies high resolution electricity grid data to a user-defined network size, the PyPSA-China network is currently fixed to one node per province (with a 340 node version in the works). This is in large part due to data availability issues.
Unlike PyPSA-EUR, which simplifies high resolution electricity grid data to a user-defined network size, the PyPSA-China network is currently fixed to one node per province (a 341 node version in the works and will be released this year)

The PyPSA can perform a number of different study types (investment decision, operational decisions, simulate AC power flows). Currently only capacity expansion problems are explicitly implemented in PyPSA-China.

The PyPSA-CHINA-PIK is currently under development. Please contact us if you intend to use it for publications.
PyPSA-China natively supports coupling with the [REMIND](https://www.pik-potsdam.de/en/institute/departments/transformation-pathways/models/remind) integrated assessment model.

## Quick Links

- 📖 [Documentation](https://pik-piam.github.io/PyPSA-China-PIK/)
- 📖 [Documentation](https://pypsa.github.io/PyPSA-China/)
- 📝 [Changelog](CHANGELOG.md)
- 🚀 [Releases](https://github.com/pik-piam/PyPSA-China-PIK/releases)
- 🚀 [Releases](https://github.com/pypsa/PyPSA-China/releases)
- 🤝 [Contributing Guide](CONTRIBUTING.md)
- 📋 [Release Guide](docs/release-guide.md) (for maintainers)

# License
The code is released under the [MIT license](https://github.com/irr-github/PyPSA-China-PIK/blob/main/LICENSES/MIT.txt), however some of the data used is more restrictive.
The code is released under the [MIT license](https://github.com/pypsa/PyPSA-China/blob/main/LICENSES/MIT.txt), however some of the data used is more restrictive.

# Documentation
The documentation can be found at https://pik-piam.github.io/PyPSA-China-PIK/
The documentation can be found at https://pypsa.github.io/PyPSA-China/

# Getting started

## Installation

An installation guide is provided at https://pik-piam.github.io/PyPSA-China-PIK/
An installation guide is provided at https://pypsa.github.io/PyPSA-China/

## Getting the data
You will need to enable data retrieval in the config
Expand All @@ -49,11 +48,10 @@ enable:
Some of the files are very large - expect a slow process!

- You can also download the data manually and copy it over to the correct folder. The source and target destinations are the input/output of the `fetch_` rules in `workflow/rules/fetch_data.smk`
- **PIK HPC users only** you can also copy the data from other users

## Usage

Detailed instructions in the documentation.
Detailed instructions in the documentation.
### local execution
- local execution can be started (once the environment is activated) with `snakemake`
- to customize the options, create `my_config.yaml` and launch `snakemake --configfile `my_config.yaml`. Configuration options are summarised in the documentation.
Expand All @@ -62,7 +60,3 @@ This is relevant for slurm HPCs and other remotes with a submit job command
- The workflow can be launched with `snakemake --profile config/compute_profile`
- [PIK HPC users only] use `snakemake --profile config/pik_hpc_profile`
- If you are not running on the PIK hpc, you will need make a new profile for your machine under `config/<compute_profile>/config.yaml`




8 changes: 4 additions & 4 deletions RELEASE_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This document provides a complete summary of the release infrastructure that has
### For Users

Users can:
1. View versioned documentation at https://pik-piam.github.io/PyPSA-China-PIK/
1. View versioned documentation at https://pypsa.github.io/PyPSA-China/
2. Select specific versions using the version selector
3. Download specific releases from GitHub
4. Track changes via CHANGELOG.md
Expand All @@ -105,7 +105,7 @@ To create a release:
```bash
# Update version in workflow/__init__.py
__version__ = "1.3.0"

# Update CHANGELOG.md with release date
## [1.3.0] - 2025-12-02
```
Expand All @@ -121,7 +121,7 @@ To create a release:
- Go to Actions → "Create Release Tag"
- Enter version (e.g., `1.3.0`)
- Click "Run workflow"

OR manually:
```bash
git tag -a v1.3.0 -m "Release version 1.3.0"
Expand Down Expand Up @@ -198,7 +198,7 @@ Standardized PR descriptions with checklist

3. **Verify Deployment**:
- Check GitHub release page
- Verify documentation at https://pik-piam.github.io/PyPSA-China-PIK/
- Verify documentation at https://pypsa.github.io/PyPSA-China/
- Test version selector

### Optional Enhancements
Expand Down
Loading
Loading