Code Duplication    Length = 35-36 lines in 2 locations

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

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