Skip to content

Commit

Permalink
debug heat pumps in pipeline.py if no sq scenario is calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
khelfen committed Jan 13, 2025
1 parent cc41866 commit 4c26240
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/egon/data/airflow/dags/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@
dependencies=[vg250, setup_etrago, create_gas_polygons]
)

# Heat pump disaggregation for status2019
heat_pumps_2019 = HeatPumpsStatusQuo(
# Heat pump disaggregation for status quo
heat_pumps_sq = HeatPumpsStatusQuo(
dependencies=[
cts_demand_buildings,
DistrictHeatingAreas,
Expand Down
64 changes: 35 additions & 29 deletions src/egon/data/datasets/heat_supply/individual_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,34 +355,42 @@ def dyn_parallel_tasks_status_quo(scenario):
)
return tasks

tasks = ()

for scenario in config.settings()["egon-data"]["--scenarios"]:
if "status" in scenario:
postfix = f"_{scenario[-4:]}"

tasks += (
wrapped_partial(
delete_heat_peak_loads_status_quo,
scenario=scenario,
postfix=postfix,
),
wrapped_partial(
delete_hp_capacity_status_quo,
scenario=scenario,
postfix=postfix,
),
wrapped_partial(
delete_mvgd_ts_status_quo,
scenario=scenario,
postfix=postfix,
),
)

tasks += (
{*dyn_parallel_tasks_status_quo(scenario)},
)
if any("status" in scenario for scenario in config.settings()["egon-data"]["--scenarios"]):
tasks = ()

for scenario in config.settings()["egon-data"]["--scenarios"]:
if "status" in scenario:
postfix = f"_{scenario[-4:]}"

tasks += (
wrapped_partial(
delete_heat_peak_loads_status_quo,
scenario=scenario,
postfix=postfix,
),
wrapped_partial(
delete_hp_capacity_status_quo,
scenario=scenario,
postfix=postfix,
),
wrapped_partial(
delete_mvgd_ts_status_quo,
scenario=scenario,
postfix=postfix,
),
)

tasks += (
{*dyn_parallel_tasks_status_quo(scenario)},
)
else:
tasks = (
PythonOperator(
task_id="HeatPumpsSQ_skipped",
python_callable=skip_task,
op_kwargs={"scn": "sq", "task": "HeatPumpsStatusQuo"},
),
)

super().__init__(
name="HeatPumpsStatusQuo",
Expand Down Expand Up @@ -433,8 +441,6 @@ def dyn_parallel_tasks_2035():
)
return tasks

tasks_HeatPumps2035 = set()

if "eGon2035" in scenarios:
tasks_HeatPumps2035 = (
delete_heat_peak_loads_2035,
Expand Down

0 comments on commit 4c26240

Please sign in to comment.