Skip to content

Commit 98f8a9f

Browse files
committed
Merge branch 'dev' into features/#250-CTS-load-areas
2 parents 3272803 + 50c9a79 commit 98f8a9f

File tree

103 files changed

+21169
-5622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+21169
-5622
lines changed

AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Authors
33
=======
44

5-
* Guido Pleßmann, Ilka Cußman, Stephan Günther - https://github.com/openego/eGon-data
5+
* Guido Pleßmann, Ilka Cußman, Stephan Günther, Jonathan Amme, Julian Endres - https://github.com/openego/eGon-data

CHANGELOG.rst

Lines changed: 172 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ Added
3333
returns the current configuration settings. See `PR #159`_ for more
3434
details.
3535

36+
* You can now use tasks which are not part of a ``Dataset``, i.e. which are
37+
unversioned, as dependencies of a dataset. See `PR #318`_ for more
38+
details.
39+
40+
* You can now force the tasks of a ``Dataset`` to be always executed by
41+
giving the version of the ``Dataset`` a ``".dev"`` suffix. See `PR
42+
#318`_ for more details.
43+
3644
* OSM data import as done in open_ego
3745
`#1 <https://github.com/openego/eGon-data/issues/1>`_
3846
which was updated to the latest long-term data set of the 2021-01-01 in
@@ -65,20 +73,26 @@ Added
6573
`#9 <https://github.com/openego/eGon-data/issues/9>`_
6674
* Add hydro and biomass power plants eGon2035
6775
`#127 <https://github.com/openego/eGon-data/issues/127>`_
68-
* Creation of the ehv/hv grid model with osmTGmod, see
69-
`issue #4 <https://github.com/openego/eGon-data/issues/4>`_ and
76+
* Creation of the ehv/hv grid model with osmTGmod, see
77+
`issue #4 <https://github.com/openego/eGon-data/issues/4>`_ and
7078
`PR #164 <https://github.com/openego/eGon-data/pull/164>`_
7179
* Identification of medium-voltage grid districts
72-
`#10 <https://github.com/openego/eGon-data/pull/10>`_
80+
`#10 <https://github.com/openego/eGon-data/pull/10>`_
7381
* Distribute electrical demands of households to zensus cells
7482
`#181 <https://github.com/openego/eGon-data/issues/181>`_
7583
* Distribute electrical demands of cts to zensus cells
7684
`#210 <https://github.com/openego/eGon-data/issues/210>`_
7785
* Include industrial sites' download, import and merge
7886
`#117 <https://github.com/openego/eGon-data/issues/117>`_
79-
* Integrate scenario table with parameters for each sector
87+
* Integrate scenario table with parameters for each sector
8088
`#177 <https://github.com/openego/eGon-data/issues/177>`_
81-
* Extract landuse areas from OSM
89+
* The volume of the docker container for the PostgreSQL database
90+
is saved in the project directory under `docker/database-data`.
91+
The current user (`$USER`) is owner of the volume.
92+
Containers created prior to this change will fail when using the
93+
changed code. The container needs to be re-created.
94+
`#228 <https://github.com/openego/eGon-data/issues/228>`_
95+
* Extract landuse areas from OSM
8296
`#214 <https://github.com/openego/eGon-data/issues/214>`_
8397
* Integrate weather data and renewable feedin timeseries
8498
`#19 <https://github.com/openego/eGon-data/issues/19>`_
@@ -88,6 +102,57 @@ Added
88102
`#109 <https://github.com/openego/eGon-data/issues/109>`_
89103
* Assign voltage level and bus_id to power plants
90104
`#15 <https://github.com/openego/eGon-data/issues/15>`_
105+
* Integrate solar rooftop for etrago tables
106+
`#255 <https://github.com/openego/eGon-data/issues/255>`_
107+
* Integrate gas bus and link tables
108+
`#198 <https://github.com/openego/eGon-data/issues/198>`_
109+
* Integrate data bundle
110+
`#272 <https://github.com/openego/eGon-data/issues/272>`_
111+
* Add household electricity demand time series, mapping of
112+
demand profiles to census cells and aggregated household
113+
electricity demand time series at MV grid district level
114+
`#256 <https://github.com/openego/eGon-data/issues/256>`_
115+
* Integrate power-to-gas installation potential links
116+
`#293 <https://github.com/openego/eGon-data/issues/293>`_
117+
* Integrate distribution of wind onshore and pv ground mounted generation
118+
`#146 <https://github.com/openego/eGon-data/issues/146>`_
119+
* Integrate dynamic line rating potentials
120+
`#72 <https://github.com/openego/eGon-data/issues/72>`_
121+
* Integrate gas voronoi polygons
122+
`#308 <https://github.com/openego/eGon-data/issues/308>`_
123+
* Integrate supply strategies for individual and district heating
124+
`#232 <https://github.com/openego/eGon-data/issues/232>`_
125+
* Integrate gas production
126+
`#321 <https://github.com/openego/eGon-data/issues/321>`_
127+
* Integrate industrial time series creation
128+
`#237 <https://github.com/openego/eGon-data/issues/237>`_
129+
* Merge electrical loads per bus and export to etrago tables
130+
`#328 <https://github.com/openego/eGon-data/issues/328>`_
131+
* Insert industial gas demand
132+
`#321 <https://github.com/openego/eGon-data/issues/358>`_
133+
* Integrate existing CHP and extdended CHP > 10MW_el
134+
`#266 <https://github.com/openego/eGon-data/issues/266>`_
135+
* Add random seed to CLI parameters
136+
`#351 <https://github.com/openego/eGon-data/issues/351>`_
137+
* Extend zensus by a combined table with all cells where
138+
there's either building, apartment or population data
139+
`#359 <https://github.com/openego/eGon-data/issues/359>`_
140+
* Include allocation of pumped hydro units
141+
`#332 <https://github.com/openego/eGon-data/issues/332>`_
142+
* Add example metadata for OSM, VG250 and Zensus VG250.
143+
Add metadata templates for licences, context and some helper
144+
functions. Extend docs on how to create metadata for tables.
145+
`#139 <https://github.com/openego/eGon-data/issues/139>`_
146+
* Integrate DSM potentials for CTS and industry
147+
`#259 <https://github.com/openego/eGon-data/issues/259>`_
148+
* Assign weather cell id to weather dependant power plants
149+
`#330 <https://github.com/openego/eGon-data/issues/330>`_
150+
* Distribute wind offshore capacities
151+
`#329 <https://github.com/openego/eGon-data/issues/329>`_
152+
* Add CH4 storages
153+
`#405 <https://github.com/openego/eGon-data/issues/405>`_
154+
* Include allocation of conventional (non CHP) power plants
155+
`#392 <https://github.com/openego/eGon-data/issues/392>`_
91156

92157
.. _PR #159: https://github.com/openego/eGon-data/pull/159
93158

@@ -122,6 +187,58 @@ Changed
122187
`#196 <https://github.com/openego/eGon-data/issues/196>`_
123188
* Update installation of demandregio's disaggregator
124189
`#202 <https://github.com/openego/eGon-data/issues/202>`_
190+
* Update etrago tables
191+
`#243 <https://github.com/openego/eGon-data/issues/243>`_and
192+
`#285 <https://github.com/openego/eGon-data/issues/285>`_
193+
* Migrate VG250 to datasets
194+
`#283 <https://github.com/openego/eGon-data/issues/283>`_
195+
* Allow configuring the airflow port
196+
`#281 <https://github.com/openego/eGon-data/issues/281>`_
197+
* Migrate mastr, mv_grid_districts and re_potential_areas to datasets
198+
`#297 <https://github.com/openego/eGon-data/issues/297>`_
199+
* Migrate industrial sites to datasets
200+
`#237 <https://github.com/openego/eGon-data/issues/237>`_
201+
* Rename etrago tables from e.g. egon_pf_hv_bus to egon_etrago bus etc.
202+
`#334 <https://github.com/openego/eGon-data/issues/334>`_
203+
* Move functions used by multiple datasets
204+
`#323 <https://github.com/openego/eGon-data/issues/323>`_
205+
* Migrate scenario tables to datasets
206+
`#309 <https://github.com/openego/eGon-data/issues/309>`_
207+
* Migrate weather data and power plants to datasets
208+
`#314 <https://github.com/openego/eGon-data/issues/314>`_
209+
* Create and fill table for CTS electricity demand per bus
210+
`#326 <https://github.com/openego/eGon-data/issues/326>`_
211+
* Migrate osmTGmod to datasets
212+
`#305 <https://github.com/openego/eGon-data/issues/305>`_
213+
* Filter osm landuse areas, rename industrial sites tables and update load curve function
214+
`#378 <https://github.com/openego/eGon-data/issues/378>`_
215+
* Remove version columns from eTraGo tables and related code
216+
`#384 <https://github.com/openego/eGon-data/issues/384>`_
217+
* Remove country column from scenario capacities table
218+
`#391 <https://github.com/openego/eGon-data/issues/391>`_
219+
* Update version of zenodo download
220+
`#397 <https://github.com/openego/eGon-data/issues/397>`_
221+
* Rename columns gid to id
222+
`#169 <https://github.com/openego/eGon-data/issues/169>`_
223+
* Remove upper version limit of pandas
224+
`#383 <https://github.com/openego/eGon-data/issues/383>`_
225+
* Use random seed from CLI parameters for CHP and society prognosis functions
226+
`#351 <https://github.com/openego/eGon-data/issues/351>`_
227+
* Changed demand.egon_schmidt_industrial_sites - table and merged table (industrial_sites)
228+
`#423 <https://github.com/openego/eGon-data/issues/423>`_
229+
* Replace 'gas' carrier with 'CH4' and 'H2' carriers
230+
`#436 <https://github.com/openego/eGon-data/issues/436>`_
231+
* Adjust file path for industrial sites import
232+
`#397 <https://github.com/openego/eGon-data/issues/418>`_
233+
* Rename columns subst_id to bus_id
234+
`#335 <https://github.com/openego/eGon-data/issues/335>`_
235+
* Apply black and isort for all python scripts
236+
`#463 <https://github.com/openego/eGon-data/issues/463>`_
237+
* Update deposit id for zenodo download
238+
`#397 <https://github.com/openego/eGon-data/issues/498>`_
239+
* Migrate dlr script to datasets
240+
`#508 <https://github.com/openego/eGon-data/issues/508>`_
241+
125242

126243
Bug fixes
127244
---------
@@ -139,7 +256,56 @@ Bug fixes
139256
`#204 <https://github.com/openego/eGon-data/issues/204>`_
140257
* Replace wrong table name in SQL function used in substation extraction
141258
`#236 <https://github.com/openego/eGon-data/issues/236>`_
142-
* Fix osmtgmod for osm data from 2021 by updating substation in Garenfeld
259+
* Fix osmtgmod for osm data from 2021 by updating substation in Garenfeld and set srid
143260
`#241 <https://github.com/openego/eGon-data/issues/241>`_
261+
`#258 <https://github.com/openego/eGon-data/issues/258>`_
144262
* Adjust format of voltage levels in hvmv substation
145263
`#248 <https://github.com/openego/eGon-data/issues/248>`_
264+
* Change order of osmtgmod tasks
265+
`#253 <https://github.com/openego/eGon-data/issues/253>`_
266+
* Fix missing municipalities
267+
`#279 <https://github.com/openego/eGon-data/issues/279>`_
268+
* Fix import of hydro power plants
269+
`#270 <https://github.com/openego/eGon-data/issues/270>`_
270+
* Fix path to osm-file for osmtgmod_osm_import
271+
`#258 <https://github.com/openego/eGon-data/issues/258>`_
272+
* Fix conflicting docker containers by setting a project name
273+
`#289 <https://github.com/openego/eGon-data/issues/289>`_
274+
* Update task insert-nep-data for pandas version 1.3.0
275+
`#322 <https://github.com/openego/eGon-data/issues/322>`_
276+
* Fix versioning conflict with mv_grid_districts
277+
`#340 <https://github.com/openego/eGon-data/issues/340>`_
278+
* Set current working directory as java's temp dir when executing osmosis
279+
`#344 <https://github.com/openego/eGon-data/issues/344>`_
280+
* Fix border gas voronoi polygons which had no bus_id
281+
`#362 <https://github.com/openego/eGon-data/issues/362>`_
282+
* Add dependency from WeatherData to Vg250
283+
`#387 <https://github.com/openego/eGon-data/issues/387>`_
284+
* Fix unnecessary columns in normal mode for inserting the gas production
285+
`#387 <https://github.com/openego/eGon-data/issues/390>`_
286+
* Add xlrd and openpyxl to installation setup
287+
`#400 <https://github.com/openego/eGon-data/issues/400>`_
288+
* Store files of OSM, zensus and VG250 in working dir
289+
`#341 <https://github.com/openego/eGon-data/issues/341>`_
290+
* Remove hard-coded slashes in file paths to ensure Windows compatibility
291+
`#398 <https://github.com/openego/eGon-data/issues/398>`_
292+
* Add missing dependency in pipeline.py
293+
`#412 <https://github.com/openego/eGon-data/issues/412>`_
294+
* Add prefix egon to MV grid district tables
295+
`#349 <https://github.com/openego/eGon-data/issues/349>`_
296+
* Bump MV grid district version no
297+
`#432 <https://github.com/openego/eGon-data/issues/432>`_
298+
* Add curl to prerequisites in the docs
299+
`#440 <https://github.com/openego/eGon-data/issues/440>`_
300+
* Replace NAN by 0 to avoid empty p_set column in DB
301+
`#414 <https://github.com/openego/eGon-data/issues/414>`_
302+
* Exchange bus 0 and bus 1 in Power-to-H2 links
303+
`#458 <https://github.com/openego/eGon-data/issues/458>`_
304+
* Fix missing cts demands for eGon2035
305+
`#511 <https://github.com/openego/eGon-data/issues/511>`_
306+
* Add `data_bundle` to `industrial_sites` task dependencies
307+
`#468 <https://github.com/openego/eGon-data/issues/468>`_
308+
* Lift `geopandas` minimum requirement to `0.10.0`
309+
`#504 <https://github.com/openego/eGon-data/issues/504>`_
310+
* Use inbuilt `datetime` package instead of `pandas.datetime`
311+
`#516 <https://github.com/openego/eGon-data/issues/516>`_

CONTRIBUTING.rst

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,15 @@ Before requesting a review, please
189189
1. Include passing tests (run ``tox``). [#tox-note]_
190190
2. Let the workflow run in :ref:`Test mode` once from scratch to verify
191191
successful execution
192-
3. Update documentation when there's new API, functionality etc.
193-
4. Add a note to ``CHANGELOG.rst`` about the changes and refer to the
192+
3. Make sure that your changes are tested in integration with other
193+
tasks and on a complete run at least once by merging them into the
194+
`continuous-integration/run-everything-over-the-weekend`_ branch.
195+
This branch will regularly be checked out and tested on a complete
196+
workflow run on friday evening.
197+
4. Update documentation when there's new API, functionality etc.
198+
5. Add a note to ``CHANGELOG.rst`` about the changes and refer to the
194199
corresponding Github issue.
195-
5. Add yourself to ``AUTHORS.rst``.
200+
6. Add yourself to ``AUTHORS.rst``.
196201

197202
.. [#tox-note]
198203
If you don't have all the necessary Python versions available locally
@@ -202,6 +207,7 @@ Before requesting a review, please
202207
It will be slower though ...
203208
204209
.. _run the tests: https://github.com/openego/eGon-data/actions?query=workflow%3A%22Tests%2C+code+style+%26+coverage%22
210+
.. _continuous-integration/run-everything-over-the-weekend: https://github.com/openego/eGon-data/tree/continuous-integration/run-everything-over-the-weekend
205211

206212

207213
When requesting reviews, please keep in mind it might be a significant effort
@@ -269,6 +275,105 @@ be saved locally, please use `CWD` to store the data. This is achieved by using
269275
filepath = Path(".") / "filename.csv"
270276
urlretrieve("https://url/to/file", filepath)
271277
278+
Add metadata
279+
------------
280+
281+
Add a metadata for every dataset you create for describing data with
282+
machine-readable information. Adhere to the OEP Metadata v1.4.1, you can
283+
follow
284+
`the example <https://github.com/OpenEnergyPlatform/oemetadata/blob/develop/metadata/latest/example.json>`_
285+
to understand how the fields are used. Field are described in detail in the
286+
`Open Energy Metadata Description`_.
287+
288+
You can obtain the metadata string from a table you created in SQL via
289+
290+
.. code-block:: sql
291+
292+
SELECT obj_description('<SCHEMA>.<TABLE>'::regclass);
293+
294+
Alternatively, you can write the table comment directly to a JSON file by
295+
296+
.. code-block:: bash
297+
298+
psql -h <HOST> -p <PORT> -d <DB> -U <USER> -c "\COPY (SELECT obj_description('<SCHEMA>.<TABLE>'::regclass)) TO '/PATH/TO/FILE.json';"
299+
300+
For bulk export of all DB's table comments you can use `this script
301+
<https://gist.github.com/nesnoj/86145999eca8182f43c2bca36bcc984f>`_.
302+
Please verify that your metadata string is in compliance with the OEP Metadata
303+
standard version 1.4.1 using the `OMI tool
304+
<https://github.com/OpenEnergyPlatform/omi>`_ (tool is shipped with eGon-data):
305+
306+
.. code-block:: bash
307+
308+
omi translate -f oep-v1.4 metadata_file.json
309+
310+
If your metadata string is correct, OMI puts the keys in the correct order and
311+
prints the full string (use `-o` option for export).
312+
313+
You may omit the fields `id` and `publicationDate` in your string as it will be
314+
automatically set at the end of the pipeline but you're required to set them to
315+
some value for a complete validation with OMI. For datasets published on the
316+
OEP `id` will be the URL which points to the table, it will follow the pattern
317+
`https://openenergy-platform.org/dataedit/view/SCHEMA/TABLE`.
318+
319+
For previous discussions on metadata, you may want to check
320+
`PR 176 <https://github.com/openego/eGon-data/pull/176>`_.
321+
322+
Helpers
323+
^^^^^^^
324+
325+
There are some **licence templates** provided in :py:mod:`egon.data.metadata`
326+
you can make use of for fields 11.4 and 12 of the
327+
`Open Energy Metadata Description`_. Also, there's a template for the
328+
**metaMetadata** (field 16).
329+
330+
There are some functions to quickly generate a template for the
331+
**resource fields** (field 14.6.1 in `Open Energy Metadata Description`_) from
332+
a SQLA table class or a DB table. This might be especially helpful if your
333+
table has plenty of columns.
334+
335+
* From SQLA table class:
336+
:py:func:`egon.data.metadata.generate_resource_fields_from_sqla_model`
337+
* From database table:
338+
:py:func:`egon.data.metadata.generate_resource_fields_from_db_table`
339+
340+
Sources
341+
^^^^^^^
342+
343+
The **sources** (field 11) are the most important parts of the metadata which
344+
need to be filled manually. You may also add references to tables in eGon-data
345+
(e.g. from an upstream task) so you don't have to list all original sources
346+
again. Make sure you include all upstream attribution requirements.
347+
348+
The following example uses various input datasets whose attribution must be
349+
retained:
350+
351+
.. code-block:: python
352+
353+
"sources": [
354+
{
355+
"title": "eGo^n - Medium voltage grid districts",
356+
"description": (
357+
"Medium-voltage grid districts describe the area supplied by "
358+
"one MV grid. Medium-voltage grid districts are defined by one "
359+
"polygon that represents the supply area. Each MV grid district "
360+
"is connected to the HV grid via a single substation."
361+
),
362+
"path": "https://openenergy-platform.org/dataedit/view/"
363+
"grid/egon_mv_grid_district", # "id" in the source dataset
364+
"licenses": [
365+
license_odbl(attribution=
366+
"© OpenStreetMap contributors, 2021; "
367+
"© Statistische Ämter des Bundes und der Länder, 2014; "
368+
"© Statistisches Bundesamt, Wiesbaden 2015; "
369+
"(Daten verändert)"
370+
)
371+
]
372+
},
373+
# more sources...
374+
]
375+
376+
.. _Open Energy Metadata Description: https://github.com/OpenEnergyPlatform/oemetadata/blob/develop/metadata/v141/metadata_key_description.md
272377

273378
Adjusting test mode data
274379
------------------------
@@ -295,7 +400,7 @@ How to document Python scripts
295400

296401
Use docstrings to document your Python code. Note that PEP 8 also
297402
contains a `section <PEP8-docstrings_>`_ on docstrings and that there is
298-
a whole `PEP <PEP257_>`_ dedicated to docstring convetions. Try to
403+
a whole `PEP <PEP257_>`_ dedicated to docstring conventions. Try to
299404
adhere to both of them.
300405
Additionally every Python script needs to contain a header describing
301406
the general functionality and objective and including information on

0 commit comments

Comments
 (0)