Code Duplication    Length = 35-36 lines in 2 locations

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

@@ 569-604 (lines=36) @@
566
    return dsm
567
568
569
def ind_sites_vent_data_import_individual(ind_vent_share, wz):
570
    """
571
    Import industry sites necessary to identify DSM-potential.
572
573
    Parameters
574
    ----------
575
    ind_vent_share: float
576
        Share of considered application in industry demand
577
    wz: int
578
        Wirtschaftszweig to be considered within industry sites
579
    """
580
581
    # import load data
582
583
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
584
        "ind_sites_loadcurves_individual"
585
    ]
586
587
    dsm = db.select_dataframe(
588
        f"""
589
        SELECT site_id, bus_id as bus, scn_name, p_set FROM
590
        {sources['schema']}.{sources['table']}
591
        WHERE wz = {wz}
592
        """
593
    )
594
595
    # calculate share of timeseries for ventilation
596
597
    timeseries = dsm["p_set"].copy()
598
599
    for index, liste in timeseries.items():
600
        share = [float(item) * ind_vent_share for item in liste]
601
        timeseries.loc[index] = share
602
603
    dsm["p_set"] = timeseries.copy()
604
605
    return dsm
606
607
@@ 530-564 (lines=35) @@
527
    return dsm
528
529
530
def ind_sites_vent_data_import(ind_vent_share, wz):
531
    """
532
    Import industry sites necessary to identify DSM-potential.
533
534
    Parameters
535
    ----------
536
    ind_vent_share: float
537
        Share of considered application in industry demand
538
    wz: int
539
        Wirtschaftszweig to be considered within industry sites
540
    """
541
542
    # import load data
543
544
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
545
        "ind_sites_loadcurves"
546
    ]
547
548
    dsm = db.select_dataframe(
549
        f"""
550
        SELECT bus, scn_name, p_set FROM
551
        {sources['schema']}.{sources['table']}
552
        WHERE wz = {wz}
553
        """
554
    )
555
556
    # calculate share of timeseries for ventilation
557
558
    timeseries = dsm["p_set"].copy()
559
560
    for index, liste in timeseries.items():
561
        share = [float(item) * ind_vent_share for item in liste]
562
        timeseries.loc[index] = share
563
564
    dsm["p_set"] = timeseries.copy()
565
566
    return dsm
567