Skip to content

Commit

Permalink
Run world (#885)
Browse files Browse the repository at this point in the history
Finalize the workflow to work with all UN countries
  • Loading branch information
davide-f authored Oct 19, 2023
1 parent d27c0b3 commit 920800f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude: ^(LICENSES)

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
Expand Down Expand Up @@ -58,7 +58,7 @@ repos:

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

# Format Snakemake rule / workflow files
- repo: https://github.com/snakemake/snakefmt
rev: v0.8.4
rev: v0.8.5
hooks:
- id: snakefmt

Expand Down
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ATLITE_NPROCESSES = config["atlite"].get("nprocesses", 4)

wildcard_constraints:
simpl="[a-zA-Z0-9]*|all",
clusters="[0-9]+m?|all",
clusters="[0-9]+(m|flex|min)?|all",
ll="(v|c)([0-9\.]+|opt|all)|all",
opts="[-+a-zA-Z0-9\.]*",
unc="[-+a-zA-Z0-9\.]*",
Expand Down
4 changes: 2 additions & 2 deletions configs/osm_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ world_iso:
MR: "mauritania"
MU: "mauritius"
MZ: "mozambique"
NA: "namibia"
"NA": "namibia"
NE: "niger"
NG: "nigeria"
RW: "rwanda"
Expand Down Expand Up @@ -219,7 +219,7 @@ world_iso:
MC: "monaco"
ME: "montenegro"
NL: "netherlands"
NO: "norway"
"NO": "norway"
PL: "poland"
PT: "portugal"
RO: "romania"
Expand Down
8 changes: 7 additions & 1 deletion scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,20 @@ def load_powerplants(ppl_fn):
"ccgt, thermal": "CCGT",
"hard coal": "coal",
}
return (
ppl = (
read_csv_nafix(ppl_fn, index_col=0, dtype={"bus": "str"})
.powerplant.to_pypsa_names()
.powerplant.convert_country_to_alpha2()
.rename(columns=str.lower)
.drop(columns=["efficiency"])
.replace({"carrier": carrier_dict})
)
# drop powerplants with null capacity
null_ppls = ppl[ppl.p_nom <= 0]
if not null_ppls.empty:
logger.warning(f"Drop powerplants with null capacity: {list(null_ppls.name)}.")
ppl = ppl.drop(null_ppls.index).reset_index(drop=True)
return ppl


def attach_load(n, demand_profiles):
Expand Down

0 comments on commit 920800f

Please sign in to comment.