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