Skip to content

Commit

Permalink
Merge branch 'features/#246-myopic-pypsaeur' into run-status2019-and-…
Browse files Browse the repository at this point in the history
…egon100re-DE
  • Loading branch information
CarlosEpia committed Nov 27, 2024
2 parents 485d2bf + 205acc6 commit 85dc373
Show file tree
Hide file tree
Showing 8 changed files with 2,835 additions and 188 deletions.
15 changes: 9 additions & 6 deletions src/egon/data/datasets/demandregio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DemandRegio(Dataset):
def __init__(self, dependencies):
super().__init__(
name="DemandRegio",
version="0.0.8",
version="0.0.9",
dependencies=dependencies,
tasks=(
# clone_and_install, demandregio must be previously installed
Expand Down Expand Up @@ -476,6 +476,9 @@ def disagg_households_power(
# calculate demand per nuts3 in 2050
df = data.households_per_size(year=year) * power_per_HH

# scale to meet annual demand from NEP 2023, scenario B 2045
df *= 90400000 / df.sum().sum()

else:
print(
f"Electric demand per household size for scenario {scenario} "
Expand Down Expand Up @@ -633,7 +636,8 @@ def insert_cts_ind(scenario, year, engine, target_values):

if scenario == "eGon100RE":
ec_cts_ind2 = pd.read_csv(
"data_bundle_powerd_data/egon_demandregio_cts_ind.csv")
"data_bundle_powerd_data/egon_demandregio_cts_ind.csv"
)
ec_cts_ind2.to_sql(
targets["cts_ind_demand"]["table"],
engine,
Expand Down Expand Up @@ -752,10 +756,8 @@ def insert_cts_ind_demands():
# according to NEP 2021
# new consumers will be added seperatly
"eGon2035": {"CTS": 135300, "industry": 225400},
# CTS: reduce overall demand from demandregio (without traffic)
# by share of heat according to JRC IDEES, data from 2011
# industry: no specific heat demand, use data from demandregio
"eGon100RE": {"CTS": (1 - (5.96 + 6.13) / 154.64) * 125183.403},
# according to NEP 2023, scenario B 2045
"eGon100RE": {"CTS": 146700, "industry": 382900},
# no adjustments for status quo
"eGon2021": {},
"status2019": {},
Expand Down Expand Up @@ -917,6 +919,7 @@ def timeseries_per_wz():
insert_timeseries_per_wz(sector, int(year))
year_already_in_database.append(year)


def get_cached_tables():
"""Get cached demandregio tables and db-dump from former runs"""
data_config = egon.data.config.datasets()
Expand Down
2 changes: 1 addition & 1 deletion src/egon/data/datasets/electrical_neighbours.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def buses(scenario, sources, targets):
central_buses.scn_name = scenario

central_buses.drop(
["control", "generator", "location", "unit", "sub_network"],
["control", "generator", "location", "unit", "sub_network", "substation_off", "substation_lv"],
axis="columns",
inplace=True,
errors="ignore"
Expand Down
10 changes: 5 additions & 5 deletions src/egon/data/datasets/pypsaeur/Snakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rule Main:
conda:
"pypsa-eur/envs/environment.yaml"
"pypsa-eur/envs/linux-pinned.yaml"
shell:
( "snakemake"
" --directory=pypsa-eur/"
Expand All @@ -10,7 +10,7 @@ rule Main:

rule prepare:
conda:
"pypsa-eur/envs/environment.yaml"
"pypsa-eur/envs/linux-pinned.yaml"
shell:
( "snakemake"
" --directory=pypsa-eur/"
Expand All @@ -21,7 +21,7 @@ rule prepare:

rule solve:
conda:
"pypsa-eur/envs/environment.yaml"
"pypsa-eur/envs/linux-pinned.yaml"
shell:
( "snakemake"
" --directory=pypsa-eur/"
Expand All @@ -32,11 +32,11 @@ rule solve:

rule summary:
conda:
"pypsa-eur/envs/environment.yaml"
"pypsa-eur/envs/linux-pinned.yaml"
shell:
( "snakemake"
" --directory=pypsa-eur/"
" --snakefile=pypsa-eur/Snakefile"
" -call"
" make_summary"
)
)
Loading

0 comments on commit 85dc373

Please sign in to comment.