Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI-check for scenario management #35

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0084135
starting a pr
yerbol-akhmetov Sep 26, 2023
7f47e39
set trigger to scenario_management branch
yerbol-akhmetov Sep 26, 2023
aecbe77
Delete last test and add two new
yerbol-akhmetov Oct 1, 2023
5703580
Update ci-linux
yerbol-akhmetov Oct 1, 2023
a12ff24
Fix filename
yerbol-akhmetov Oct 1, 2023
b160286
Print statement
yerbol-akhmetov Oct 1, 2023
0c08fb1
Fix tab in snakefile
yerbol-akhmetov Oct 1, 2023
0d62cc3
check kz.smk
yerbol-akhmetov Oct 1, 2023
231108e
Make default config config.yaml
yerbol-akhmetov Oct 1, 2023
7ae3310
chenge cutout name
yerbol-akhmetov Oct 1, 2023
11cb705
Replace cutout
yerbol-akhmetov Oct 1, 2023
5fbcd9f
cutout build false
yerbol-akhmetov Oct 2, 2023
a453ea8
Add config
yerbol-akhmetov Oct 2, 2023
b47d08d
set build natura raster false
yerbol-akhmetov Oct 2, 2023
66825db
view config
yerbol-akhmetov Oct 2, 2023
dfded25
Add default test config
yerbol-akhmetov Oct 2, 2023
5dc79d5
add default test config
yerbol-akhmetov Oct 2, 2023
1ed3de4
Leave one test
yerbol-akhmetov Oct 3, 2023
d3cef10
Add cat statement
yerbol-akhmetov Oct 3, 2023
c6f3578
remove cat
yerbol-akhmetov Oct 3, 2023
e777a98
rename project name in test config
yerbol-akhmetov Oct 3, 2023
a4c6700
remove test1 from build_test_configs input
yerbol-akhmetov Oct 3, 2023
999f1b4
remove cat
yerbol-akhmetov Oct 4, 2023
002c007
change nchancks to 10
yerbol-akhmetov Oct 4, 2023
8591861
Show progress
yerbol-akhmetov Oct 5, 2023
ecf8e24
ask for xlarge resources
yerbol-akhmetov Oct 5, 2023
444d3aa
revert back to latest
yerbol-akhmetov Oct 5, 2023
26962bf
making gadm0 and copying gpkg file
yerbol-akhmetov Oct 8, 2023
ed77982
adding gadm file
yerbol-akhmetov Oct 8, 2023
855b7b1
Setting nchanks to 3
yerbol-akhmetov Oct 9, 2023
f0bd511
Set gadm level0
yerbol-akhmetov Oct 9, 2023
8f83022
set alternative clustering false
yerbol-akhmetov Oct 9, 2023
17c6d28
set alternative clustering false
yerbol-akhmetov Oct 9, 2023
b7e83f7
delete extra config
yerbol-akhmetov Oct 9, 2023
4426d15
set solve_all_networks to Snakefile
yerbol-akhmetov Oct 9, 2023
6a00ede
alternative false
yerbol-akhmetov Oct 10, 2023
92b9c77
fix = to :
yerbol-akhmetov Oct 10, 2023
a4a0a0b
set nchunks to 3
yerbol-akhmetov Oct 10, 2023
d8ecbd1
update badge
yerbol-akhmetov Oct 11, 2023
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
45 changes: 37 additions & 8 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: CI-Linux
on:
push:
branches:
- main
- scenario_management
pull_request:
branches:
- main
- scenario_management
schedule:
- cron: "0 5 * * TUE"

Expand Down Expand Up @@ -72,18 +72,47 @@ jobs:
- name: Move test config
run: |
cd ../pypsa-earth
cp pypsa-kz-data/test/config_kz_test.yaml ./test/config.custom.yaml
cp pypsa-kz-data/test/config_kz_default_test.yaml ./test/config.landlock.yaml

- name: Create test configs
run: |
cd ../pypsa-earth
snakemake --cores all build_test_configs

- name: Test pypsa-kz-data workflow
- name: Clean scenarios folder
run: |
cd ../pypsa-earth
cp ./test/tmp/config.custom_tmp.yaml ./config.yaml
snakemake -j1 retrieve_databundle_light # we first retrieve data
cp pypsa-kz-data/data/custom_powerplants.csv ./data/custom_powerplants.csv # overwrite powerplantdata
snakemake -j1 solve_everything
rm -r pypsa-kz-data/scenarios/*

- name: Move test configs to scenario folder
run: |
cd ../pypsa-earth
cp pypsa-kz-data/test/config_kz_test1.yaml pypsa-kz-data/scenarios/config.kz_2013.yaml
cp ./test/tmp/config.landlock_tmp.yaml pypsa-kz-data/config.kz_default.yaml

- name : Change Snakefile lines
run: |
cd ../pypsa-earth
sed -i 's\os.system("snakemake -j all solve_all_networks --rerun-incomplete")\os.system(f"snakemake -j1 networks/{wildcards.scenario_name}/base.nc")\g' Snakefile
sed -i 's,os.system("snakemake -j1 make_statistics --force"),os.system("cp pypsa-kz-data/data/custom_powerplants.csv data/custom_powerplants.csv")\n\tos.system("snakemake -j1 solve_all_networks --rerun-incomplete"),g' Snakefile
cat Snakefile

- name: Replace Default config
run: |
cd ../pypsa-earth
cp pypsa-kz-data/config.kz_default.yaml config.default.yaml
cp config.default.yaml config.yaml

- name: Prepare KZ-scenarios
run: |
cd ../pypsa-earth
snakemake -j1 prepare_kz_scenarios
cp -r pypsa-kz-data/test/gadm ./data/gadm
find data -type f
cat configs/scenarios/config.kz_2013.yaml

- name: Run all scenarios
run: |
cd ../pypsa-earth
snakemake -j1 run_all_scenarios

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Agora Energiewende aims to model the Kazakh power system, incorporating a substa

## Development status: Active and Stable

[![CI-Linux](https://github.com/pypsa-meets-earth/pypsa-kz-data/actions/workflows/ci-linux.yml/badge.svg?branch=main&event=push)](https://github.com/pypsa-meets-earth/pypsa-kz-data/actions/workflows/ci-linux.yml)
[![CI-Linux](https://github.com/pypsa-meets-earth/pypsa-kz-data/actions/workflows/ci-linux.yml/badge.svg?branch=main)](https://github.com/pypsa-meets-earth/pypsa-kz-data/actions/workflows/ci-linux.yml)
![Size](https://img.shields.io/github/repo-size/pypsa-meets-earth/pypsa-kz-data?label=Repo%20size)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPLv3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![REUSE status](https://api.reuse.software/badge/github.com/pypsa-meets-earth/pypsa-kz-data)](https://api.reuse.software/info/github.com/pypsa-meets-earth/pypsa-kz-data)
Expand Down
10 changes: 5 additions & 5 deletions test/config_kz_test.yaml → test/config_kz_default_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
tutorial: false

run:
name: "kz_test" # use this to keep track of runs with different settings
name: "kz_2013_default" # use this to keep track of runs with different settings
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled

scenario:
ll: ['v1.0']
clusters: [14]
opts: [RES0.2-1H]
clusters: [5]
opts: [BAU-RES0.2-6H]


countries: ["KZ"]
Expand All @@ -38,13 +38,13 @@ cluster_options:
simplify_network:
p_threshold_drop_isolated: 10 # [MW] isolated buses are being discarded if bus mean power is below the specified threshold

alternative_clustering: true #false # "False" use Voronoi shapes, "True" use GADM shapes
alternative_clustering: false # "False" use Voronoi shapes, "True" use GADM shapes


build_shape_options:
nprocesses: 1 # number of processes to be used in build_shapes
nchunks: 3 # number of data chuncks for build_shapes. If not specified or smaller than nprocesses, specified as nprocesses

gadm_layer_id: 0

load_options:
rescale_demand: true
Expand Down
117 changes: 117 additions & 0 deletions test/config_kz_test1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# SPDX-FileCopyrightText: pypsa-kz-data authors
#
# SPDX-License-Identifier: CC0-1.0


tutorial: false

run:
name: "kz_2013" # use this to keep track of runs with different settings
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled

scenario:
ll: ['v1.0']
clusters: [5]
opts: [6H]


countries: ["KZ"]

snapshots:
start: "2013-01-01"
end: "2013-01-02"


enable:
build_natura_raster: false # If True, than an exclusion raster will be build


retrieve_databundle: # required to be "false" for nice CI test output
show_progress: true #false # show (true) or do not show (false) the progress bar in retrieve_databundle while downloading data


custom_rules: ["pypsa-kz-data/kz.smk"]


cluster_options:
simplify_network:
p_threshold_drop_isolated: 10 # [MW] isolated buses are being discarded if bus mean power is below the specified threshold

alternative_clustering: false # "False" use Voronoi shapes, "True" use GADM shapes


build_shape_options:
nprocesses: 1 # number of processes to be used in build_shapes
nchunks: 3 # number of data chuncks for build_shapes. If not specified or smaller than nprocesses, specified as nprocesses
gadm_layer_id: 0

load_options:
rescale_demand: true
external_loads: true # true - adds external load buses based on data/custom_data/electricity_exp-imp.csv

electricity:
base_voltage: 500.
voltages: [110., 220., 500.]
co2limit: 7.75e+11 # European default, 0.05 * 3.1e9*0.5, needs to be adjusted for Africa
co2base: 3.17e+8 # Kazakhstan default for 1990


extendable_carriers:
Generator: []


custom_powerplants: replace #merge #replace # "false" - no custom powerplants, "merge" use both open source and custom powerplants, "replace" use only custom powerplants


estimate_renewable_capacities:
stats: False #'irena' # False, = greenfield expansion, 'irena' uses IRENA stats to add expansion limits


lines:
types:
220.: "490-AL1/64-ST1A 220.0" #"Al/St 240/40 2-bundle 220.0"
110.: "243-AL1/39-ST1A 110.0" #"Al/St 240/40 3-bundle 300.0"
500.: "Al/St 240/40 4-bundle 380.0" #"Al/St 560/50 4-bundle 750.0" #

modify_lines:
limit_line_capacities: true # limiting line capacities
bus_of_interest: ["KZ.1_1_AC", "KZ.9_1_AC"] # buses of interest whose lines are limited
max_limit: 700.0 # maximum limit for s_nom


atlite:
nprocesses: 4
cutouts:
# geographical bounds automatically determined from countries input
cutout-2013-era5-tutorial:
module: era5
dx: 0.3 # cutout resolution
dy: 0.3 # cutout resolution


renewable:
onwind:
cutout: cutout-2013-era5-tutorial

offwind-ac:
cutout: cutout-2013-era5-tutorial

offwind-dc:
cutout: cutout-2013-era5-tutorial

solar:
cutout: cutout-2013-era5-tutorial

hydro:
cutout: cutout-2013-era5-tutorial
extendable: true
normalization:
method: eia #hydro_capacities # 'hydro_capacities' to rescale country hydro production by using hydro_capacities, 'eia' to rescale by eia data, false for no rescaling
year: 2013 # (optional) year of statistics used to rescale the runoff time series. When not provided, the weather year of the snapshots is used


costs:
year: 2020
fill_values:
discount rate: 0.15
Binary file added test/gadm/gadm41_KAZ/gadm41_KAZ.gpkg
Binary file not shown.
Loading