Code Duplication    Length = 33-33 lines in 2 locations

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

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