Code Duplication    Length = 35-36 lines in 2 locations

src/egon/data/datasets/DSM_cts_ind.py 2 locations

@@ 310-345 (lines=36) @@
307
    return dsm
308
309
310
def ind_sites_vent_data_import_individual(ind_vent_share, wz):
311
    """
312
    Import industry sites necessary to identify DSM-potential.
313
        ----------
314
    ind_vent_share: float
315
        Share of considered application in industry demand
316
    wz: int
317
        Wirtschaftszweig to be considered within industry sites
318
    """
319
320
    # import load data
321
322
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
323
        "ind_sites_loadcurves_individual"
324
    ]
325
326
    dsm = db.select_dataframe(
327
        f"""
328
        SELECT site_id, bus_id as bus, scn_name, p_set FROM
329
        {sources['schema']}.{sources['table']}
330
        WHERE scn_name IN ('eGon2035', 'eGon100RE')
331
        AND wz = '{wz}'
332
        """
333
    )
334
335
    # calculate share of timeseries for ventilation
336
337
    timeseries = dsm["p_set"].copy()
338
339
    for index, liste in timeseries.iteritems():
340
        share = [float(item) * ind_vent_share for item in liste]
341
        timeseries.loc[index] = share
342
343
    dsm["p_set"] = timeseries.copy()
344
345
    return dsm
346
347
348
def calc_ind_site_timeseries(scenario):
@@ 273-307 (lines=35) @@
270
    return dsm
271
272
273
def ind_sites_vent_data_import(ind_vent_share, wz):
274
    """
275
    Import industry sites necessary to identify DSM-potential.
276
        ----------
277
    ind_vent_share: float
278
        Share of considered application in industry demand
279
    wz: int
280
        Wirtschaftszweig to be considered within industry sites
281
    """
282
283
    # import load data
284
285
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
286
        "ind_sites_loadcurves"
287
    ]
288
289
    dsm = db.select_dataframe(
290
        f"""
291
        SELECT bus, scn_name, p_set FROM
292
        {sources['schema']}.{sources['table']}
293
        WHERE wz = '{wz}'
294
        """
295
    )
296
297
    # calculate share of timeseries for ventilation
298
299
    timeseries = dsm["p_set"].copy()
300
301
    for index, liste in timeseries.iteritems():
302
        share = [float(item) * ind_vent_share for item in liste]
303
        timeseries.loc[index] = share
304
305
    dsm["p_set"] = timeseries.copy()
306
307
    return dsm
308
309
310
def ind_sites_vent_data_import_individual(ind_vent_share, wz):