diff --git a/ding0/core/__init__.py b/ding0/core/__init__.py index 3394a8e0..0a8a630e 100644 --- a/ding0/core/__init__.py +++ b/ding0/core/__init__.py @@ -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(): @@ -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(): @@ -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 diff --git a/doc/whatsnew/v0-1-4.rst b/doc/whatsnew/v0-1-4.rst index 5b076d6e..e289c69a 100644 --- a/doc/whatsnew/v0-1-4.rst +++ b/doc/whatsnew/v0-1-4.rst @@ -13,6 +13,7 @@ Bug fixes Other changes ------------- +* Generators with unknown subtype have subtype 'unknown' now