Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ __pycache__
!**.gitkeep
.vscode/launch.json
/workflow/logs/*
.claude
CLAUDE.md
74 changes: 74 additions & 0 deletions workflow/envs/environment-local-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# SPDX-License-Identifier: MIT
# PyPSA-China-PIK environment for local macOS execution.
# Tested 2026-05-12 on macOS arm64 (under x86_64 anaconda via Rosetta).
# Differs from environment.yaml by hard-pinning 4 versions for the solve path.

name: pypsa-china
channels:
- conda-forge
- bioconda
dependencies:
# --- HARD PINS (necessary for solve to work) ---
- python=3.12.* # 3.13 breaks numpy<2 indirect chain
- pypsa=0.35.1 # PIK code targets this exact API
- linopy=0.5.5 # 0.6+ adds force_dim_names check incompat w/ pypsa 0.35.1
- xarray=2024.10.0 # 2025+ breaks Dataset constructor used by linopy 0.5.5
- numpy<2 # required by xarray 2024.10

# --- core (unpinned: conda picks compatible) ---
- pip
- atlite>=0.4.0
- dask
- coincbc
- snakemake-storage-plugin-http
- xlrd
- libgdal-hdf5
- libgdal-netcdf
- rioxarray<0.21 # 0.21+ requires numpy>=2; cap to numpy 1.26 compatible
- openpyxl
- pycountry
- seaborn
- snakemake-minimal>=9.0
- memory_profiler
- yaml
- pytables
- lxml
- powerplantmatching>=0.4.8
- pandas<3
- geopandas<2
- netcdf4
- networkx
- scipy
- shapely
- progressbar2
- pyomo
- matplotlib
- proj
- fiona
- geopy
- tqdm
- pytz
- country_converter
- tabula-py
- chardet
- ultraplot
- ipython
- pytest
- cartopy
- descartes
- rasterio

- pip:
- vresutils>=0.3.1
- tsam>=1.1.0
- gurobipy==12.0.3
- jwt
- remind-pypsa-coupling>=0.1.2
- mkdocs>=1.4.0
- mkdocs-material>=9.0.0
- mkdocs-gen-files
- mkdocstrings[python]
- mkdocs-awesome-nav
- mike>=1.1.0
- python-markdown-math
- pre-commit>=4.0.0
4 changes: 2 additions & 2 deletions workflow/rules/fetch_data.smk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if config["enable"].get("retrieve_raster", True):
"""retrieve GEBCO 2025 bathymetry data from Zenodo bundle"""
input:
gebco=storage.http(
"https://zenodo.org/record/17697456/files/GEBCO_tiff.zip"
"https://zenodo.org/records/17697456/files/GEBCO_tiff.zip"
),
output:
gebco="resources/data/landuse_availability/GEBCO_tiff/gebco_2025_CN.tif",
Expand Down Expand Up @@ -98,7 +98,7 @@ elif config["enable"].get("retrieve_cutout", False):
rule retrieve_cutout:
input:
zenodo_cutout=storage.http(
"https://zenodo.org/record/16792792/files/China-2020c.nc"
"https://zenodo.org/records/16792792/files/China-2020c.nc"
),
output:
cutout="resources/cutouts/China-2020c.nc",
Expand Down