Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data sets descriptions #1139

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions src/egon/data/datasets/demandregio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,40 @@


class DemandRegio(Dataset):
"""
Extract and adjust data from DemandRegio

Demand data for the sectors households, CTS and industry are calculated
using DemandRegio's diaggregator and input data. To bring the resulting
data in line with other data used in eGon-data and the eGon project in
general some data needed to be adjusted or extended, e.g. in function
:py:func:`adjust_ind_pes` or function :py:func:`adjust_cts_ind_nep`. The
resulting data is written into newly created tables.

*Dependencies*
* :py:class:`DataBundle <egon.data.datasets.data_bundle.DataBundle>`
* :py:class:`ScenarioParameters <egon.data.datasets.scenario_parameters.ScenarioParameters>`
* :py:class:`ZensusVg250 <egon.data.datasets.zensus_vg250.ZensusVg250>`

*Resulting tables*
* :py:class:`demand.egon_demandregio_hh <egon.data.datasets.demandregio.EgonDemandRegioHH>` is created and filled
* :py:class:`demand.egon_demandregio_cts_ind <egon.data.datasets.demandregio.EgonDemandRegioCtsInd>` is created and filled
* :py:class:`society.egon_demandregio_population <egon.data.datasets.demandregio.EgonDemandRegioPopulation>` is created and filled
* :py:class:`society.egon_demandregio_household <egon.data.datasets.demandregio.EgonDemandRegioHouseholds>` is created and filled
* :py:class:`demand.egon_demandregio_wz <egon.data.datasets.demandregio.EgonDemandRegioWz>` is created and filled
* :py:class:`demand.egon_demandregio_timeseries_cts_ind <egon.data.datasets.demandregio.EgonDemandRegioTimeseriesCtsInd>` is created and filled

"""

#:
name: str = "DemandRegio"
#:
version: str = "0.0.5"

def __init__(self, dependencies):
super().__init__(
name="DemandRegio",
version="0.0.5",
name=self.name,
version=self.version,
dependencies=dependencies,
tasks=(
clone_and_install,
Expand Down
62 changes: 58 additions & 4 deletions src/egon/data/datasets/electricity_demand/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,74 @@


class HouseholdElectricityDemand(Dataset):
"""
Create table and store data on household electricity demands per census cell

Create a table to store the annual electricity demand for households on census cell level.
In a next step the annual electricity demand per cell is determined by
executing function :py:func:`get_annual_household_el_demand_cells`

*Dependencies*
* :py:class:`DemandRegio <egon.data.datasets.demandregio>`
* :py:class:`DataBundle <egon.data.datasets.data_bundle.DataBundle>`

*Resulting tables*
* :py:class:`demand.egon_demandregio_zensus_electricity <egon.data.datasets.electricity_demand.EgonDemandRegioZensusElectricity>` is created and filled

"""

#:
name: str = "HouseholdElectricityDemand"
#:
version: str = "0.0.3"

def __init__(self, dependencies):
super().__init__(
name="HouseholdElectricityDemand",
version="0.0.3",
name=self.name,
version=self.version,
dependencies=dependencies,
tasks=(create_tables, get_annual_household_el_demand_cells),
)


class CtsElectricityDemand(Dataset):
"""
Create table and store data on cts electricity demands per census cell

Creates a table to store data on electricity demands from the cts sector on
census cell level. For a spatial distribution of electricity demands data
from DemandRegio, which provides the data on NUT3-level, is used and
distributed to census cells according to heat demand data from Peta.
Annual demands are then aggregated per MV grid district and a corresponding
time series is created taking the shares of different cts branches and their
specific standard load profiles into account.


*Dependencies*
* :py:class:`MapZensusGridDistricts <egon.data.datasets.zensus_mv_grid_districts.MapZensusGridDistricts>`
* :py:class:`DemandRegio <egon.data.datasets.demandregio.DemandRegio>`
* :py:class:`HeatDemandImport <egon.data.datasets.heat_demand.HeatDemandImport>`
* :py:class:`HouseholdElectricityDemand <egon.data.datasets.electricity_demand.HouseholdElectricityDemand>`
* :py:class:`EtragoSetup <egon.data.datasets.etrago_setup.EtragoSetup>`
* :py:class:`ZensusMvGridDistricts <egon.data.datasets.zensus_mv_grid_districts.ZensusMvGridDistricts>`
* :py:class:`ZensusVg250 <egon.data.datasets.zensus_vg250.ZensusVg250>`


*Resulting tables*
* :py:class:`demand.egon_etrago_electricity_cts <egon.data.datasets.electricity_demand.temporal.EgonEtragoElectricityCts>` is created and filled


"""

#:
name: str = "CtsElectricityDemand"
#:
version: str = "0.0.2"

def __init__(self, dependencies):
super().__init__(
name="CtsElectricityDemand",
version="0.0.2",
name=self.name,
version=self.version,
dependencies=dependencies,
tasks=(distribute_cts_demands, insert_cts_load),
)
Expand Down
30 changes: 27 additions & 3 deletions src/egon/data/datasets/electricity_demand_etrago.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def export_to_db():
WHERE scn_name = '{scenario}'
AND carrier = 'AC'
AND bus IN (
SELECT bus_id FROM
SELECT bus_id FROM
{sources['etrago_buses']['schema']}.
{sources['etrago_buses']['table']}
WHERE country = 'DE'
Expand Down Expand Up @@ -268,10 +268,34 @@ def export_to_db():


class ElectricalLoadEtrago(Dataset):
"""
Aggregate annual and hourly electricity demands per substation and export
to eTraGo tables

All loads including time series are aggregated per corresponding substation
and inserted into the existing eTraGo tables. Additionally the aggregated
national time series are stored to function as an input for pypsa-eur-sec.


*Dependencies*
* :py:class:`CtsElectricityDemand <egon.data.datasets.electricity_demand.CtsElectricityDemand>`
* :py:class:`IndustrialDemandCurves <egon.data.datasets.industry.IndustrialDemandCurves>`
* :py:class:`hh_buildings <egon.data.datasets.electricity_demand_timeseries.hh_buildings>`

*Resulting tables*
* :py:class:`grid.egon_etrago_load <egon.data.datasets.etrago_setup.EgonPfHvLoad>` is extended
* :py:class:`grid.egon_etrago_load_timeseries <egon.data.datasets.etrago_setup.EgonPfHvLoadTimeseries>` is extended
"""

#:
name: str = "Electrical_load_etrago"
#:
version: str = "0.0.6"

def __init__(self, dependencies):
super().__init__(
name="Electrical_load_etrago",
version="0.0.6",
name=self.name,
version=self.version,
dependencies=dependencies,
tasks=(export_to_db,),
)
37 changes: 35 additions & 2 deletions src/egon/data/datasets/industry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,43 @@ def industrial_demand_distr():


class IndustrialDemandCurves(Dataset):
"""
Distribute industrial electricity demands to industrial sites and OSM
landuse areas

Creates different tables to store industrial electricity demand curves on
different aggregation levels. In a first step industrial demands taken from
DemandRegio are distributed to industrial sites and OSM polygons which are
tagged as industrial areas. This method takes information on the different
industrial sectors into account and allocates the annual demand as well as
load curves accordingly.

*Dependencies*
* :py:class:`DemandRegio <egon.data.datasets.demandregio.DemandRegio>`
* :py:class:`MergeIndustrialSites <egon.data.datasets.industrial_sites.MergeIndustrialSites>`
* :py:class:`OsmLanduse <egon.data.datasets.loadarea.OsmLanduse>`
* :py:func:`define_mv_grid_districts <egon.data.datasets.mv_grid_districts.define_mv_grid_districts>`
* :py:class:`OpenStreetMap <egon.data.datasets.osm.OpenStreetMap>`

*Resulting tables*
* :py:class:`demand.egon_demandregio_osm_ind_electricity <egon.data.datasets.industry.EgonDemandRegioOsmIndElectricity>` is created and filled
* :py:class:`demand.egon_demandregio_sites_ind_electricity <egon.data.datasets.industry.EgonDemandRegioSitesIndElectricity>` is created and filled
* :py:class:`demand.egon_osm_ind_load_curves <egon.data.datasets.industry.DemandCurvesOsmIndustry>` is created and filled
* :py:class:`demand.egon_osm_ind_load_curves_individual <egon.data.datasets.industry.DemandCurvesOsmIndustryIndividual>` is created and filled
* :py:class:`demand.egon_sites_ind_load_curves <egon.data.datasets.industry.DemandCurvesSitesIndustry>` is created and filled
* :py:class:`demand.egon_sites_ind_load_curves_individual <egon.data.datasets.industry.DemandCurvesSitesIndustryIndividual>` is created and filled

"""

#:
name: str = "Industrial_demand_curves"
#:
version: str = "0.0.5"

def __init__(self, dependencies):
super().__init__(
name="Industrial_demand_curves",
version="0.0.5",
name=self.name,
version=self.version,
dependencies=dependencies,
tasks=(
create_tables,
Expand Down
54 changes: 41 additions & 13 deletions src/egon/data/datasets/osmtgmod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,19 +627,19 @@ def to_pypsa():
WHERE a.line_id = result.line_id
AND scn_name = {scenario_name};

-- set capital costs for eHV-lines
-- set capital costs for eHV-lines
UPDATE grid.egon_etrago_line
SET capital_cost = {capital_cost['ac_ehv_overhead_line']} * length
WHERE v_nom > 110
AND scn_name = {scenario_name};

-- set capital costs for HV-lines
-- set capital costs for HV-lines
UPDATE grid.egon_etrago_line
SET capital_cost = {capital_cost['ac_hv_overhead_line']} * length
WHERE v_nom = 110
AND scn_name = {scenario_name};
-- set capital costs for transformers

-- set capital costs for transformers
UPDATE grid.egon_etrago_transformer a
SET capital_cost = {capital_cost['transformer_380_220']}
WHERE (a.bus0 IN (
Expand Down Expand Up @@ -687,20 +687,20 @@ def to_pypsa():
SELECT bus_id FROM grid.egon_etrago_bus
WHERE v_nom = 220))
AND scn_name = {scenario_name};
-- set lifetime for eHV-lines

-- set lifetime for eHV-lines
UPDATE grid.egon_etrago_line
SET lifetime = {lifetime['ac_ehv_overhead_line']}
SET lifetime = {lifetime['ac_ehv_overhead_line']}
WHERE v_nom > 110
AND scn_name = {scenario_name};

-- set capital costs for HV-lines
-- set capital costs for HV-lines
UPDATE grid.egon_etrago_line
SET lifetime = {lifetime['ac_hv_overhead_line']}
WHERE v_nom = 110
AND scn_name = {scenario_name};
-- set capital costs for transformers

-- set capital costs for transformers
UPDATE grid.egon_etrago_transformer a
SET lifetime = {lifetime['transformer_380_220']}
WHERE (a.bus0 IN (
Expand Down Expand Up @@ -748,7 +748,7 @@ def to_pypsa():
SELECT bus_id FROM grid.egon_etrago_bus
WHERE v_nom = 220))
AND scn_name = {scenario_name};

-- delete buses without connection to AC grid and generation or
-- load assigned

Expand All @@ -772,10 +772,38 @@ def to_pypsa():


class Osmtgmod(Dataset):
"""
Run the tool osmtgmod to generate transmission grid topology

Executes the tool osmtgmod which create a electricity grid topology based
on OSM data for the voltage levels 110 - 380 kV. For further information
on osmtgmod please refer our `osmtgmod fork. <https://github.com/openego/osmTGmod>`_
Standard electrical line parameters are added to the grid topology and
resulting data on buses, lines and transformers are exported to the data
base.

*Dependencies*
* :py:class:`ScenarioParameters <egon.data.datasets.scenario_parameters.ScenarioParameters>`
* :py:class:`EtragoSetup <egon.data.datasets.etrago_setup.EtragoSetup>`
* :py:class:`SubstationExtraction <egon.data.datasets.substation.SubstationExtraction>`
* :py:class:`OpenStreetMap <egon.data.datasets.osm.OpenStreetMap>`

*Resulting tables*
* :py:class:`grid.egon_etrago_bus <egon.data.datasets.etrago_setup.EgonPfHvBus>` is extended
* :py:class:`grid.egon_etrago_line <egon.data.datasets.etrago_setup.EgonPfHvLine>` is extended
* :py:class:`grid.egon_etrago_transformer <egon.data.datasets.etrago_setup.EgonPfHvTransformer>` is extended

"""

#:
name: str = "Osmtgmod"
#:
version: str = "0.0.5"

def __init__(self, dependencies):
super().__init__(
name="Osmtgmod",
version="0.0.5",
name=self.name,
version=self.version,
dependencies=dependencies,
tasks=(
import_osm_data,
Expand Down
Loading