Code Duplication    Length = 32-35 lines in 2 locations

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

@@ 489-523 (lines=35) @@
486
    return dsm
487
488
489
def ind_osm_data_import_individual(ind_vent_cool_share):
490
    """
491
    Import industry data per osm-area necessary to identify DSM-potential.
492
        ----------
493
    ind_share: float
494
        Share of considered application in industry demand
495
    """
496
497
    # import load data
498
499
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
500
        "ind_osm_loadcurves_individual"
501
    ]
502
503
    dsm = db.select_dataframe(
504
        f"""
505
        SELECT osm_id, bus_id as bus, scn_name, p_set FROM
506
        {sources['schema']}.{sources['table']}
507
        """
508
    )
509
510
    # calculate share of timeseries for cooling and ventilation out of
511
    # industry-data
512
513
    timeseries = dsm["p_set"].copy()
514
515
    for index, liste in timeseries.items():
516
        share = [float(item) * ind_vent_cool_share for item in liste]
517
518
        timeseries.loc[index] = share
519
520
    dsm["p_set"] = timeseries.copy()
521
522
    return dsm
523
524
525
def ind_sites_vent_data_import(ind_vent_share, wz):
526
    """
@@ 453-484 (lines=32) @@
450
    return dsm
451
452
453
def ind_osm_data_import(ind_vent_cool_share):
454
    """
455
    Import industry data per osm-area necessary to identify DSM-potential.
456
        ----------
457
    ind_share: float
458
        Share of considered application in industry demand
459
    """
460
461
    # import load data
462
463
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
464
        "ind_osm_loadcurves"
465
    ]
466
467
    dsm = db.select_dataframe(
468
        f"""
469
        SELECT bus, scn_name, p_set FROM
470
        {sources['schema']}.{sources['table']}
471
        """
472
    )
473
474
    # calculate share of timeseries for cooling and ventilation out of
475
    # industry-data
476
477
    timeseries = dsm["p_set"].copy()
478
479
    for index, liste in timeseries.items():
480
        share = [float(item) * ind_vent_cool_share for item in liste]
481
482
        timeseries.loc[index] = share
483
484
    dsm["p_set"] = timeseries.copy()
485
486
    return dsm
487