Skip to content

Commit

Permalink
Fix sphinx warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
birgits committed Feb 7, 2024
1 parent 76c9c4a commit 01129ba
Show file tree
Hide file tree
Showing 29 changed files with 423 additions and 340 deletions.
49 changes: 31 additions & 18 deletions src/egon/data/datasets/DSM_cts_ind.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The sum of the individual time series is a more accurate value than the
aggregated time series used so far and should replace it in the future. Since
the deviations are relatively small, a tolerance is currently accepted in the
sanity checks. See [#1120](https://github.com/openego/eGon-data/issues/1120)
sanity checks. See `#1120 <https://github.com/openego/eGon-data/issues/1120>`_
for updates.
"""
from sqlalchemy import ARRAY, Column, Float, Integer, String
Expand Down Expand Up @@ -210,6 +210,7 @@ def cts_data_import(cts_cool_vent_ac_share):
"""
Import CTS data necessary to identify DSM-potential.
Parameters
----------
cts_share: float
Share of cooling, ventilation and AC in CTS demand
Expand Down Expand Up @@ -251,7 +252,9 @@ def cts_data_import(cts_cool_vent_ac_share):
def ind_osm_data_import(ind_vent_cool_share):
"""
Import industry data per osm-area necessary to identify DSM-potential.
----------
Parameters
----------
ind_share: float
Share of considered application in industry demand
"""
Expand Down Expand Up @@ -287,7 +290,9 @@ def ind_osm_data_import(ind_vent_cool_share):
def ind_osm_data_import_individual(ind_vent_cool_share):
"""
Import industry data per osm-area necessary to identify DSM-potential.
----------
Parameters
----------
ind_share: float
Share of considered application in industry demand
"""
Expand Down Expand Up @@ -323,7 +328,9 @@ def ind_osm_data_import_individual(ind_vent_cool_share):
def ind_sites_vent_data_import(ind_vent_share, wz):
"""
Import industry sites necessary to identify DSM-potential.
----------
Parameters
----------
ind_vent_share: float
Share of considered application in industry demand
wz: int
Expand Down Expand Up @@ -360,7 +367,9 @@ def ind_sites_vent_data_import(ind_vent_share, wz):
def ind_sites_vent_data_import_individual(ind_vent_share, wz):
"""
Import industry sites necessary to identify DSM-potential.
----------
Parameters
----------
ind_vent_share: float
Share of considered application in industry demand
wz: int
Expand Down Expand Up @@ -520,9 +529,10 @@ def ind_sites_data_import():
def calculate_potentials(s_flex, s_util, s_inc, s_dec, delta_t, dsm):
"""
Calculate DSM-potential per bus using the methods by Heitkoetter et. al.:
https://doi.org/10.1016/j.adapen.2020.100001
https://doi.org/10.1016/j.adapen.2020.100001
Parameters
----------
----------
s_flex: float
Feasability factor to account for socio-technical restrictions
s_util: float
Expand Down Expand Up @@ -615,8 +625,9 @@ def create_dsm_components(
):
"""
Create components representing DSM.
Parameters
----------
----------
con :
Connection to database
p_max: DataFrame
Expand Down Expand Up @@ -990,8 +1001,8 @@ def delete_dsm_entries(carrier):
new ones.
Parameters
----------
carrier: str
----------
carrier: str
Remark in column 'carrier' identifying DSM-potential
"""

Expand Down Expand Up @@ -1059,14 +1070,15 @@ def dsm_cts_ind(
):
"""
Execute methodology to create and implement components for DSM considering
a) CTS per osm-area: combined potentials of cooling, ventilation and air
conditioning
conditioning
b) Industry per osm-are: combined potentials of cooling and ventilation
c) Industrial Sites: potentials of ventilation in sites of
"Wirtschaftszweig" (WZ) 23
"Wirtschaftszweig" (WZ) 23
d) Industrial Sites: potentials of sites specified by subsectors
identified by Schmidt (https://zenodo.org/record/3613767#.YTsGwVtCRhG):
Paper, Recycled Paper, Pulp, Cement
identified by Schmidt (https://zenodo.org/record/3613767#.YTsGwVtCRhG):
Paper, Recycled Paper, Pulp, Cement
Modelled using the methods by Heitkoetter et. al.:
https://doi.org/10.1016/j.adapen.2020.100001
Expand Down Expand Up @@ -1374,14 +1386,15 @@ def dsm_cts_ind_individual(
):
"""
Execute methodology to create and implement components for DSM considering
a) CTS per osm-area: combined potentials of cooling, ventilation and air
conditioning
conditioning
b) Industry per osm-are: combined potentials of cooling and ventilation
c) Industrial Sites: potentials of ventilation in sites of
"Wirtschaftszweig" (WZ) 23
"Wirtschaftszweig" (WZ) 23
d) Industrial Sites: potentials of sites specified by subsectors
identified by Schmidt (https://zenodo.org/record/3613767#.YTsGwVtCRhG):
Paper, Recycled Paper, Pulp, Cement
identified by Schmidt (https://zenodo.org/record/3613767#.YTsGwVtCRhG):
Paper, Recycled Paper, Pulp, Cement
Modelled using the methods by Heitkoetter et. al.:
https://doi.org/10.1016/j.adapen.2020.100001
Expand Down
39 changes: 20 additions & 19 deletions src/egon/data/datasets/ch4_prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,26 @@ def import_gas_generators(scn_name="eGon2035"):
To insert the gas production units into the database, the following
steps are followed:
* cleaning of the database table grid.egon_etrago_generator of the
CH4 generators of the specific scenario (eGon2035),
* call of the functions :py:func:`load_NG_generators` and
:py:func:`load_biogas_generators` that respectively return
dataframes containing the natural- an bio-gas production units
in Germany,
* attribution of the bus_id to which each generator is connected
(call the function :func:`assign_gas_bus_id <egon.data.db.assign_gas_bus_id>`
from :py:mod:`egon.data.db <egon.data.db>`),
* aggregation of the CH4 productions with same properties at the
same bus. The properties that should be the same in order that
different generators are aggregated are:
* scenario
* carrier
* marginal cost: this parameter differentiates the natural gas
generators from the biogas generators,
* addition of the missing columns: scn_name, carrier and
generator_id,
* insertion of the generators into the database.
* cleaning of the database table grid.egon_etrago_generator of the
CH4 generators of the specific scenario (eGon2035),
* call of the functions :py:func:`load_NG_generators` and
:py:func:`load_biogas_generators` that respectively return
dataframes containing the natural- an bio-gas production units
in Germany,
* attribution of the bus_id to which each generator is connected
(call the function :func:`assign_gas_bus_id <egon.data.db.assign_gas_bus_id>`
from :py:mod:`egon.data.db <egon.data.db>`),
* aggregation of the CH4 productions with same properties at the
same bus. The properties that should be the same in order that
different generators are aggregated are:
* scenario
* carrier
* marginal cost: this parameter differentiates the natural gas
generators from the biogas generators,
* addition of the missing columns: scn_name, carrier and
generator_id,
* insertion of the generators into the database.
Parameters
----------
Expand Down
23 changes: 12 additions & 11 deletions src/egon/data/datasets/ch4_storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,16 @@ def insert_ch4_stores(scn_name):
Insert non extendable gas stores for specific scenario in Germany
by executing the following steps:
* Clean the database.
* For CH4 stores, call the functions
:py:func:`import_installed_ch4_storages` to get the CH4
cavern stores and :py:func:`import_ch4_grid_capacity` to
get the CH4 stores modelling the storage capacity of the
grid.
* Aggregate the stores attached to the same bus.
* Add the missing columns: store_id, scn_name, carrier, e_cyclic.
* Insert the stores into the database.
* Clean the database.
* For CH4 stores, call the functions
:py:func:`import_installed_ch4_storages` to get the CH4
cavern stores and :py:func:`import_ch4_grid_capacity` to
get the CH4 stores modelling the storage capacity of the
grid.
* Aggregate the stores attached to the same bus.
* Add the missing columns: store_id, scn_name, carrier, e_cyclic.
* Insert the stores into the database.
Parameters
----------
Expand All @@ -302,12 +303,12 @@ def insert_ch4_stores(scn_name):
# Clean table
db.execute_sql(
f"""
DELETE FROM {target['stores']['schema']}.{target['stores']['table']}
DELETE FROM {target['stores']['schema']}.{target['stores']['table']}
WHERE "carrier" = 'CH4'
AND scn_name = '{scn_name}'
AND bus IN (
SELECT bus_id FROM {source['buses']['schema']}.{source['buses']['table']}
WHERE scn_name = '{scn_name}'
WHERE scn_name = '{scn_name}'
AND country = 'DE'
);
"""
Expand Down
8 changes: 0 additions & 8 deletions src/egon/data/datasets/district_heating_areas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,6 @@ def area_grouping(
join: geopandas.geodataframe.GeoDataFrame
cell polygons with area id
Notes
-----
None
TODO
----
"""

buffer_distance = distance + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,44 +143,43 @@ class CtsDemandBuildings(Dataset):
*Resulting tables*
* :py:class:`openstreetmap.osm_buildings_synthetic <egon.data.datasets.electricity_demand_timeseries.hh_buildings.OsmBuildingsSynthetic>` is extended
* :py:class:`openstreetmap.egon_cts_buildings <egon.data.datasets.electricity_demand_timeseries.cts_buildings.CtsBuildings> is created
* :py:class:`openstreetmap.egon_cts_buildings <egon.data.datasets.electricity_demand_timeseries.cts_buildings.CtsBuildings>` is created
* :py:class:`demand.egon_cts_electricity_demand_building_share <egon.data.datasets.electricity_demand_timeseries.cts_buildings.EgonCtsElectricityDemandBuildingShare>` is created
* :py:class:`demand.egon_cts_heat_demand_building_share <egon.data.datasets.electricity_demand_timeseries.cts_buildings.EgonCtsHeatDemandBuildingShare>` is created
* :py:class:`demand.egon_building_electricity_peak_loads <egon.data.datasets.electricity_demand_timeseries.hh_buildings.BuildingElectricityPeakLoads>` is extended
* :py:class:`boundaries.egon_map_zensus_mvgd_buildings <egon.data.datasets.electricity_demand_timeseries.mapping.EgonMapZensusMvgdBuildings>` is extended.
**The following datasets from the database are mainly used for creation:**
* `openstreetmap.osm_buildings_filtered`:
Table of OSM-buildings filtered by tags to selecting residential and cts
buildings only.
Table of OSM-buildings filtered by tags to selecting residential and cts
buildings only.
* `openstreetmap.osm_amenities_shops_filtered`:
Table of OSM-amenities filtered by tags to select cts only.
Table of OSM-amenities filtered by tags to select cts only.
* `openstreetmap.osm_amenities_not_in_buildings_filtered`:
Table of amenities which do not intersect with any building from
`openstreetmap.osm_buildings_filtered`
Table of amenities which do not intersect with any building from
`openstreetmap.osm_buildings_filtered`
* `openstreetmap.osm_buildings_synthetic`:
Table of synthetic residential buildings
Table of synthetic residential buildings
* `boundaries.egon_map_zensus_buildings_filtered_all`:
Mapping table of census cells and buildings filtered even if population
in census cell = 0.
Mapping table of census cells and buildings filtered even if population
in census cell = 0.
* `demand.egon_demandregio_zensus_electricity`:
Table of annual electricity load demand for residential and cts at census
cell level. Residential load demand is derived from aggregated residential
building profiles. DemandRegio CTS load demand at NUTS3 is distributed to
census cells linearly to heat demand from peta5.
Table of annual electricity load demand for residential and cts at census
cell level. Residential load demand is derived from aggregated residential
building profiles. DemandRegio CTS load demand at NUTS3 is distributed to
census cells linearly to heat demand from peta5.
* `demand.egon_peta_heat`:
Table of annual heat load demand for residential and cts at census cell
level from peta5.
Table of annual heat load demand for residential and cts at census cell
level from peta5.
* `demand.egon_etrago_electricity_cts`:
Scaled cts electricity time series for every MV substation. Derived from
DemandRegio SLP for selected economic sectors at nuts3. Scaled with annual
demand from `demand.egon_demandregio_zensus_electricity`
Scaled cts electricity time series for every MV substation. Derived from
DemandRegio SLP for selected economic sectors at nuts3. Scaled with annual
demand from `demand.egon_demandregio_zensus_electricity`
* `demand.egon_etrago_heat_cts`:
Scaled cts heat time series for every MV substation. Derived from
DemandRegio SLP Gas for selected economic sectors at nuts3. Scaled with
annual demand from `demand.egon_peta_heat`.
Scaled cts heat time series for every MV substation. Derived from
DemandRegio SLP Gas for selected economic sectors at nuts3. Scaled with
annual demand from `demand.egon_peta_heat`.
**What is the challenge?**
Expand Down Expand Up @@ -1166,7 +1165,7 @@ def cts_buildings():
building nor amenity is available, random synthetic buildings are
generated. The demand share is stored in the database.
Note:
Note
-----
Cells with CTS demand, amenities and buildings do not change within
the scenarios, only the demand itself. Therefore scenario eGon2035
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,8 @@ def map_houseprofiles_to_buildings():
buildings and supplementary data as well as the mapping table is stored
in the db.
Tables:
----------
**Tables**
synthetic_buildings:
schema: openstreetmap
tablename: osm_buildings_synthetic
Expand All @@ -661,8 +661,6 @@ def map_houseprofiles_to_buildings():
schema: demand
tablename: egon_household_electricity_profile_of_buildings
Notes
-----
"""
#
egon_map_zensus_buildings_residential = Table(
Expand Down Expand Up @@ -833,8 +831,7 @@ class setup(Dataset):
* As this dataset uses the load profile assignment at census cell level
conducted in hh_profiles.py, also check drawbacks and limitations in that module.
Example Query
----------------
**Example Query**
* Get a list with number of houses, households and household types per
census cell
Expand Down
Loading

0 comments on commit 01129ba

Please sign in to comment.