Code Duplication    Length = 35-36 lines in 2 locations

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

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