Skip to content

Commit

Permalink
Merge pull request #57 from openego/fixes/#add-scenario-capacities-da…
Browse files Browse the repository at this point in the history
…taset

Add scenario capacities to pipeline
  • Loading branch information
ulfmueller authored May 25, 2023
2 parents 5ec3aa0 + 4ea0de3 commit 4d593bc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
13 changes: 13 additions & 0 deletions src/egon/data/airflow/dags/pipeline_status_quo.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
from egon.data.datasets.power_plants import PowerPlants
from egon.data.datasets.pypsaeursec import PypsaEurSec
from egon.data.datasets.renewable_feedin import RenewableFeedin
from egon.data.datasets.scenario_capacities import ScenarioCapacities
from egon.data.datasets.scenario_parameters import ScenarioParameters
from egon.data.datasets.society_prognosis import SocietyPrognosis
from egon.data.datasets.storages import Storages
Expand Down Expand Up @@ -322,6 +323,17 @@
dependencies=[run_pypsaeursec, tyndp_data]
)

# Import NEP (Netzentwicklungsplan) data
scenario_capacities = ScenarioCapacities(
dependencies=[
data_bundle,
run_pypsaeursec,
setup,
vg250,
zensus_population,
]
)

# Import gas grid
gas_grid_insert_data = GasNodesAndPipes(
dependencies=[
Expand Down Expand Up @@ -404,6 +416,7 @@
data_bundle,
district_heating_areas,
zensus_mv_grid_districts,
scenario_capacities,
]
)
# Pumped hydro units
Expand Down
37 changes: 22 additions & 15 deletions src/egon/data/datasets/scenario_capacities.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,6 @@ class NEP2021ConvPowerPlants(Base):
b2040_capacity = Column(Float)


class ScenarioCapacities(Dataset):
def __init__(self, dependencies):
super().__init__(
name="ScenarioCapacities",
version="0.0.13",
dependencies=dependencies,
tasks=(
create_table,
insert_capacities_status2019,
insert_data_nep,
eGon100_capacities,
),
)


def create_table():
"""Create input tables for scenario setup
Expand Down Expand Up @@ -800,3 +785,25 @@ def eGon100_capacities():
if_exists="append",
index=False,
)


tasks = (create_table,)

if "status2019" in egon.data.config.settings()["egon-data"]["--scenarios"]:
tasks = tasks + (insert_capacities_status2019,)

if "eGon2035" in egon.data.config.settings()["egon-data"]["--scenarios"]:
tasks = tasks + (insert_data_nep,)

if "eGon100RE" in egon.data.config.settings()["egon-data"]["--scenarios"]:
tasks = tasks + (eGon100_capacities,)


class ScenarioCapacities(Dataset):
def __init__(self, dependencies):
super().__init__(
name="ScenarioCapacities",
version="0.0.14",
dependencies=dependencies,
tasks=tasks,
)

0 comments on commit 4d593bc

Please sign in to comment.