Code Duplication    Length = 32-35 lines in 2 locations

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

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