Skip to content

Commit 920800f

Browse files
authored
Run world (#885)
Finalize the workflow to work with all UN countries
1 parent d27c0b3 commit 920800f

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exclude: ^(LICENSES)
99

1010
repos:
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.4.0
12+
rev: v4.5.0
1313
hooks:
1414
- id: check-merge-conflict
1515
- id: end-of-file-fixer
@@ -58,7 +58,7 @@ repos:
5858

5959
# Do YAML formatting (before the linter checks it for misses)
6060
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
61-
rev: v2.10.0
61+
rev: v2.11.0
6262
hooks:
6363
- id: pretty-format-yaml
6464
args: [--autofix, --indent, '2', --preserve-quotes]
@@ -72,7 +72,7 @@ repos:
7272

7373
# Format Snakemake rule / workflow files
7474
- repo: https://github.com/snakemake/snakefmt
75-
rev: v0.8.4
75+
rev: v0.8.5
7676
hooks:
7777
- id: snakefmt
7878

Snakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ATLITE_NPROCESSES = config["atlite"].get("nprocesses", 4)
5353

5454
wildcard_constraints:
5555
simpl="[a-zA-Z0-9]*|all",
56-
clusters="[0-9]+m?|all",
56+
clusters="[0-9]+(m|flex|min)?|all",
5757
ll="(v|c)([0-9\.]+|opt|all)|all",
5858
opts="[-+a-zA-Z0-9\.]*",
5959
unc="[-+a-zA-Z0-9\.]*",

configs/osm_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ world_iso:
9393
MR: "mauritania"
9494
MU: "mauritius"
9595
MZ: "mozambique"
96-
NA: "namibia"
96+
"NA": "namibia"
9797
NE: "niger"
9898
NG: "nigeria"
9999
RW: "rwanda"
@@ -219,7 +219,7 @@ world_iso:
219219
MC: "monaco"
220220
ME: "montenegro"
221221
NL: "netherlands"
222-
NO: "norway"
222+
"NO": "norway"
223223
PL: "poland"
224224
PT: "portugal"
225225
RO: "romania"

scripts/add_electricity.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,20 @@ def load_powerplants(ppl_fn):
220220
"ccgt, thermal": "CCGT",
221221
"hard coal": "coal",
222222
}
223-
return (
223+
ppl = (
224224
read_csv_nafix(ppl_fn, index_col=0, dtype={"bus": "str"})
225225
.powerplant.to_pypsa_names()
226226
.powerplant.convert_country_to_alpha2()
227227
.rename(columns=str.lower)
228228
.drop(columns=["efficiency"])
229229
.replace({"carrier": carrier_dict})
230230
)
231+
# drop powerplants with null capacity
232+
null_ppls = ppl[ppl.p_nom <= 0]
233+
if not null_ppls.empty:
234+
logger.warning(f"Drop powerplants with null capacity: {list(null_ppls.name)}.")
235+
ppl = ppl.drop(null_ppls.index).reset_index(drop=True)
236+
return ppl
231237

232238

233239
def attach_load(n, demand_profiles):

0 commit comments

Comments
 (0)