Code Duplication    Length = 32-35 lines in 2 locations

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

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