Code Duplication    Length = 35-36 lines in 2 locations

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

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