Skip to content

Commit

Permalink
Override unknow subtype by 'unknown'
Browse files Browse the repository at this point in the history
If a subtype of a RES generator is unknow it is set to 'unknown'.
Conventional generators' subtype is set to 'unknown' by default.

Tested with MV grid districts in Ding0 and eDisGo.
* 391
* 2507
* 1066
* 1117
* 1167

Above MVGDs include both RES generators with unknown subtype and
conventional generators.

For further discussion details see
[here](openego/eDisGo#35).
  • Loading branch information
gplessm committed Sep 21, 2017
1 parent e245686 commit effb54e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ding0/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,10 @@ def import_generators(self, conn, debug=False):
conn: SQLalchemy database connection
debug: If True, information is printed during process
Notes:
Connection of generators is done later on in NetworkDing0's method connect_generators()
Connection of generators is done later on in NetworkDing0's method
:func:`connect_generators()`.
If subtype is not specified it's set to 'unknown'.
"""

def import_res_generators():
Expand Down Expand Up @@ -717,6 +720,10 @@ def import_res_generators():
generators = pd.read_sql_query(generators_sqla.statement,
session.bind,
index_col='id')
# define generators with unknown subtype as 'unknown'
generators.loc[generators[
'generation_subtype'].isnull(),
'generation_subtype'] = 'unknown'

for id_db, row in generators.iterrows():

Expand Down Expand Up @@ -836,6 +843,7 @@ def import_conv_generators():
mv_grid=mv_grid,
capacity=row['capacity'],
type=row['fuel'],
subtype='unknown',
v_level=int(row['voltage_level']))

# add generators to graph
Expand Down
1 change: 1 addition & 0 deletions doc/whatsnew/v0-1-4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Bug fixes

Other changes
-------------
* Generators with unknown subtype have subtype 'unknown' now



Expand Down

0 comments on commit effb54e

Please sign in to comment.