Skip to content

Commit

Permalink
Merge #903 updates into integrating #799 and #903
Browse files Browse the repository at this point in the history
  • Loading branch information
gnn committed Nov 14, 2022
2 parents 688b26d + 2e40a99 commit 772916d
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ Added
`#868 <https://github.com/openego/eGon-data/issues/868>`_
* Write simBEV metadata to DB table
`PR #978 <https://github.com/openego/eGon-data/pull/978>`_
* Heat pump desaggregation to buildings
`PR #903 <https://github.com/openego/eGon-data/pull/903>`_

.. _PR #159: https://github.com/openego/eGon-data/pull/159
.. _PR #703: https://github.com/openego/eGon-data/pull/703
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
Table including the mv substation heat profile share of all selected
cts buildings for scenario eGon2035 and eGon100RE. This table is created
within :func:`cts_heat()`
* `demand.egon_building_peak_loads`:
Mapping of demand time series and buildings including cell_id, building
area and peak load. This table is already created within
* `demand.egon_building_electricity_peak_loads`:
Mapping of electricity demand time series and buildings including cell_id,
building area and peak load. This table is already created within
:func:`hh_buildings.get_building_peak_loads()`
**The following datasets from the database are mainly used for creation:**
Expand Down Expand Up @@ -247,7 +247,7 @@ class CtsDemandBuildings(Dataset):
def __init__(self, dependencies):
super().__init__(
name="CtsDemandBuildings",
version="0.0.0",
version="0.0.1",
dependencies=dependencies,
tasks=(
cts_buildings,
Expand Down
110 changes: 87 additions & 23 deletions src/egon/data/datasets/heat_supply/individual_heating.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,89 @@
"""The central module containing all code dealing with
individual heat supply.
"""The central module containing all code dealing with individual heat supply.
The desaggregation of heat pump capcacities takes place in three separate
datasets: 'HeatPumpsPypsaEurSec', 'HeatPumps2035', 'HeatPumps2050'.
#TODO WHY?
The resulting data is stored in separate tables
* `demand.egon_hp_capacity_buildings`:
This table is already created within
:func:``
* `demand.egon_etrago_timeseries_individual_heating`:
This table is created within
:func:``
* `demand.egon_building_heat_peak_loads`:
Mapping of heat demand time series and buildings including cell_id,
building, area and peak load. This table is created in
:func:``
**The following datasets from the database are mainly used for creation:**
* `boundaries.egon_map_zensus_grid_districts`:
* `boundaries.egon_map_zensus_district_heating_areas`:
* `demand.egon_peta_heat`:
Table of annual heat load demand for residential and cts at census cell
level from peta5.
* `demand.egon_heat_timeseries_selected_profiles`:
* `demand.egon_heat_idp_pool`:
* `demand.egon_daily_heat_demand_per_climate_zone`:
* `boundaries.egon_map_zensus_mvgd_buildings`:
A final mapping table including all buildings used for residential and
cts, heat and electricity timeseries. Including census cells, mvgd bus_id,
building type (osm or synthetic)
* `supply.egon_individual_heating`:
* `demand.egon_cts_heat_demand_building_share`:
Table including the mv substation heat profile share of all selected
cts buildings for scenario eGon2035 and eGon100RE. This table is created
within :func:`cts_heat()`
**What is the goal?**
**What is the challenge?**
**How are these datasets combined?**
**What are central assumptions during the data processing?**
**Drawbacks and limitations of the data**
Example Query
-----
Notes
-----
This module docstring is rather a dataset documentation. Once, a decision
is made in ... the content of this module docstring needs to be moved to
docs attribute of the respective dataset class.
"""


from pathlib import Path
import os
import random
import time

from airflow.operators.python_operator import PythonOperator
from psycopg2.extensions import AsIs, register_adapter
Expand Down Expand Up @@ -106,9 +184,11 @@ def dyn_parallel_tasks_pypsa_eur_sec():
name="HeatPumpsPypsaEurSec",
version="0.0.2",
dependencies=dependencies,
tasks=(delete_mvgd_ts_100RE,
delete_heat_peak_loads_100RE,
{*dyn_parallel_tasks_pypsa_eur_sec()},),
tasks=(
delete_mvgd_ts_100RE,
delete_heat_peak_loads_100RE,
{*dyn_parallel_tasks_pypsa_eur_sec()},
),
)


Expand Down Expand Up @@ -195,23 +275,6 @@ def adapt_numpy_int64(numpy_int64):
return AsIs(numpy_int64)


def timeit(func):
"""
Decorator for measuring function's running time.
"""

def measure_time(*args, **kw):
start_time = time.time()
result = func(*args, **kw)
print(
"Processing time of %s(): %.2f seconds."
% (func.__qualname__, time.time() - start_time)
)
return result

return measure_time


def cascade_per_technology(
heat_per_mv,
technologies,
Expand Down Expand Up @@ -1860,6 +1923,7 @@ def delete_heat_peak_loads_2035():
BuildingHeatPeakLoads.scenario == "eGon2035"
).delete(synchronize_session=False)


def delete_heat_peak_loads_100RE():
"""Remove all heat peak loads for eGon100RE."""
BuildingHeatPeakLoads.__table__.create(bind=engine, checkfirst=True)
Expand Down

0 comments on commit 772916d

Please sign in to comment.