Code Duplication    Length = 33-33 lines in 2 locations

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

@@ 157-189 (lines=33) @@
154
    return dsm
155
156
157
def ind_osm_data_import_individual(ind_vent_cool_share):
158
    """
159
    Import industry data per osm-area necessary to identify DSM-potential.
160
        ----------
161
    ind_share: float
162
        Share of considered application in industry demand
163
    """
164
165
    # import load data
166
167
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
168
        "ind_osm_loadcurves_individual"
169
    ]
170
171
    dsm = db.select_dataframe(
172
        f"""
173
        SELECT osm_id, bus_id as bus, scn_name, p_set FROM
174
        {sources['schema']}.{sources['table']}
175
        WHERE scn_name in ('eGon2035', 'eGon100RE')
176
        """
177
    )
178
179
    # calculate share of timeseries for cooling and ventilation out of
180
    # industry-data
181
182
    timeseries = dsm["p_set"].copy()
183
184
    for index, liste in timeseries.iteritems():
185
        share = [float(item) * ind_vent_cool_share for item in liste]
186
187
        timeseries.loc[index] = share
188
189
    dsm["p_set"] = timeseries.copy()
190
191
    return dsm
192
@@ 123-155 (lines=33) @@
120
    return dsm
121
122
123
def ind_osm_data_import(ind_vent_cool_share):
124
    """
125
    Import industry data per osm-area necessary to identify DSM-potential.
126
        ----------
127
    ind_share: float
128
        Share of considered application in industry demand
129
    """
130
131
    # import load data
132
133
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
134
        "ind_osm_loadcurves"
135
    ]
136
137
    dsm = db.select_dataframe(
138
        f"""SELECT bus, scn_name, p_set FROM
139
        {sources['schema']}.{sources['table']}"""
140
    )
141
142
    # calculate share of timeseries for cooling and ventilation out of
143
    # industry-data
144
145
    timeseries = dsm["p_set"].copy()
146
147
    for index, liste in timeseries.iteritems():
148
        share = [float(item) * ind_vent_cool_share for item in liste]
149
150
        timeseries.loc[index] = share
151
152
    dsm["p_set"] = timeseries.copy()
153
154
    return dsm
155
156
157
def ind_osm_data_import_individual(ind_vent_cool_share):
158
    """