Code Duplication    Length = 35-36 lines in 2 locations

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

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