Code Duplication    Length = 32-35 lines in 2 locations

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

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