Code Duplication    Length = 32-35 lines in 2 locations

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

@@ 206-237 (lines=32) @@
203
    return dsm
204
205
206
def ind_osm_data_import(ind_vent_cool_share):
207
    """
208
    Import industry data per osm-area necessary to identify DSM-potential.
209
        ----------
210
    ind_share: float
211
        Share of considered application in industry demand
212
    """
213
214
    # import load data
215
216
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
217
        "ind_osm_loadcurves"
218
    ]
219
220
    dsm = db.select_dataframe(
221
        f"""
222
        SELECT bus, scn_name, p_set FROM
223
        {sources['schema']}.{sources['table']}
224
        WHERE scn_name IN ('eGon2035', 'eGon100RE')
225
        """
226
    )
227
228
    # calculate share of timeseries for cooling and ventilation out of
229
    # industry-data
230
231
    timeseries = dsm["p_set"].copy()
232
233
    for index, liste in timeseries.items():
234
        share = [float(item) * ind_vent_cool_share for item in liste]
235
236
        timeseries.loc[index] = share
237
238
    dsm["p_set"] = timeseries.copy()
239
240
    return dsm
@@ 243-277 (lines=35) @@
240
    return dsm
241
242
243
def ind_osm_data_import_individual(ind_vent_cool_share):
244
    """
245
    Import industry data per osm-area necessary to identify DSM-potential.
246
        ----------
247
    ind_share: float
248
        Share of considered application in industry demand
249
    """
250
251
    # import load data
252
253
    sources = config.datasets()["DSM_CTS_industry"]["sources"][
254
        "ind_osm_loadcurves_individual"
255
    ]
256
257
    dsm = db.select_dataframe(
258
        f"""
259
        SELECT osm_id, bus_id as bus, scn_name, p_set FROM
260
        {sources['schema']}.{sources['table']}
261
        WHERE scn_name in ('eGon2035', 'eGon100RE')
262
        """
263
    )
264
265
    # calculate share of timeseries for cooling and ventilation out of
266
    # industry-data
267
268
    timeseries = dsm["p_set"].copy()
269
270
    for index, liste in timeseries.items():
271
        share = [float(item) * ind_vent_cool_share for item in liste]
272
273
        timeseries.loc[index] = share
274
275
    dsm["p_set"] = timeseries.copy()
276
277
    return dsm
278
279
280
def ind_sites_vent_data_import(ind_vent_share, wz):