Code Duplication    Length = 35-36 lines in 2 locations

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

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