Code Duplication    Length = 26-29 lines in 5 locations

src/egon/data/datasets/power_plants/mastr_db_classes.py 5 locations

@@ 254-282 (lines=29) @@
251
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
252
253
254
class EgonPowerPlantsStorage(Base):
255
    __tablename__ = "egon_power_plants_storage"
256
    __table_args__ = {"schema": "supply"}
257
258
    id = Column(Integer, Sequence("pp_storage_seq"), primary_key=True)
259
    bus_id = Column(Integer, nullable=True)  # Grid district id
260
    gens_id = Column(String, nullable=True)  # EinheitMastrNummer
261
262
    status = Column(String, nullable=True)  # EinheitBetriebsstatus
263
    commissioning_date = Column(DateTime, nullable=True)  # Inbetriebnahmedatum
264
    postcode = Column(String(5), nullable=True)  # Postleitzahl
265
    city = Column(String(50), nullable=True)  # Ort
266
    municipality = Column(String, nullable=True)  # Gemeinde
267
    federal_state = Column(String(31), nullable=True)  # Bundesland
268
    zip_and_municipality = Column(String, nullable=True)
269
270
    carrier = Column(String)  # Energietraeger
271
    technology = Column(String)  # Technologie
272
    battery_type = Column(String)  # Batterietechnologie
273
    pump_storage_type = Column(String)  # Pumpspeichertechnologie
274
275
    capacity = Column(Float, nullable=True)  # Nettonennleistung
276
    th_capacity = Column(Float, nullable=True)  # ThermischeNutzleistung
277
    feedin_type = Column(String(47), nullable=True)  # Einspeisungsart
278
    voltage_level = Column(Integer, nullable=True)
279
    voltage_level_inferred = Column(Boolean, nullable=True)
280
281
    geometry_geocoded = Column(Boolean)
282
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
283
@@ 165-193 (lines=29) @@
162
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
163
164
165
class EgonPowerPlantsCombustion(Base):
166
    __tablename__ = "egon_power_plants_combustion"
167
    __table_args__ = {"schema": "supply"}
168
169
    id = Column(Integer, Sequence("pp_combustion_seq"), primary_key=True)
170
    bus_id = Column(Integer, nullable=True)  # Grid district id
171
    gens_id = Column(String, nullable=True)  # EinheitMastrNummer
172
173
    status = Column(String, nullable=True)  # EinheitBetriebsstatus
174
    commissioning_date = Column(DateTime, nullable=True)  # Inbetriebnahmedatum
175
    postcode = Column(String(5), nullable=True)  # Postleitzahl
176
    city = Column(String(50), nullable=True)  # Ort
177
    municipality = Column(String, nullable=True)  # Gemeinde
178
    federal_state = Column(String(31), nullable=True)  # Bundesland
179
    zip_and_municipality = Column(String, nullable=True)
180
181
    carrier = Column(String)  # Energietraeger
182
    main_fuel = Column(String)  # Hauptbrennstoff
183
    other_main_fuel = Column(String)  # WeitererHauptbrennstoff
184
    technology = Column(String)  # Technologie
185
186
    capacity = Column(Float, nullable=True)  # Nettonennleistung
187
    th_capacity = Column(Float, nullable=True)  # ThermischeNutzleistung
188
    feedin_type = Column(String(47), nullable=True)  # Einspeisungsart
189
    voltage_level = Column(Integer, nullable=True)
190
    voltage_level_inferred = Column(Boolean, nullable=True)
191
192
    geometry_geocoded = Column(Boolean)
193
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
194
195
196
class EgonPowerPlantsGsgk(Base):
@@ 225-251 (lines=27) @@
222
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
223
224
225
class EgonPowerPlantsNuclear(Base):
226
    __tablename__ = "egon_power_plants_nuclear"
227
    __table_args__ = {"schema": "supply"}
228
229
    id = Column(Integer, Sequence("pp_nuclear_seq"), primary_key=True)
230
    bus_id = Column(Integer, nullable=True)  # Grid district id
231
    gens_id = Column(String, nullable=True)  # EinheitMastrNummer
232
233
    status = Column(String, nullable=True)  # EinheitBetriebsstatus
234
    commissioning_date = Column(DateTime, nullable=True)  # Inbetriebnahmedatum
235
    postcode = Column(String(5), nullable=True)  # Postleitzahl
236
    city = Column(String(50), nullable=True)  # Ort
237
    municipality = Column(String, nullable=True)  # Gemeinde
238
    federal_state = Column(String(31), nullable=True)  # Bundesland
239
    zip_and_municipality = Column(String, nullable=True)
240
241
    carrier = Column(String)  # Energietraeger
242
    technology = Column(String)  # Technologie
243
244
    capacity = Column(Float, nullable=True)  # Nettonennleistung
245
    th_capacity = Column(Float, nullable=True)  # ThermischeNutzleistung
246
    feedin_type = Column(String(47), nullable=True)  # Einspeisungsart
247
    voltage_level = Column(Integer, nullable=True)
248
    voltage_level_inferred = Column(Boolean, nullable=True)
249
250
    geometry_geocoded = Column(Boolean)
251
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
252
253
254
class EgonPowerPlantsStorage(Base):
@@ 196-222 (lines=27) @@
193
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
194
195
196
class EgonPowerPlantsGsgk(Base):
197
    __tablename__ = "egon_power_plants_gsgk"
198
    __table_args__ = {"schema": "supply"}
199
200
    id = Column(Integer, Sequence("pp_gsgk_seq"), primary_key=True)
201
    bus_id = Column(Integer, nullable=True)  # Grid district id
202
    gens_id = Column(String, nullable=True)  # EinheitMastrNummer
203
204
    status = Column(String, nullable=True)  # EinheitBetriebsstatus
205
    commissioning_date = Column(DateTime, nullable=True)  # Inbetriebnahmedatum
206
    postcode = Column(String(5), nullable=True)  # Postleitzahl
207
    city = Column(String(50), nullable=True)  # Ort
208
    municipality = Column(String, nullable=True)  # Gemeinde
209
    federal_state = Column(String(31), nullable=True)  # Bundesland
210
    zip_and_municipality = Column(String, nullable=True)
211
212
    carrier = Column(String)  # Energietraeger
213
    technology = Column(String)  # Technologie
214
215
    capacity = Column(Float, nullable=True)  # Nettonennleistung
216
    th_capacity = Column(Float, nullable=True)  # ThermischeNutzleistung
217
    feedin_type = Column(String(47), nullable=True)  # Einspeisungsart
218
    voltage_level = Column(Integer, nullable=True)
219
    voltage_level_inferred = Column(Boolean, nullable=True)
220
221
    geometry_geocoded = Column(Boolean)
222
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
223
224
225
class EgonPowerPlantsNuclear(Base):
@@ 137-162 (lines=26) @@
134
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
135
136
137
class EgonPowerPlantsHydro(Base):
138
    __tablename__ = "egon_power_plants_hydro"
139
    __table_args__ = {"schema": "supply"}
140
141
    id = Column(Integer, Sequence("pp_hydro_seq"), primary_key=True)
142
    bus_id = Column(Integer, nullable=True)  # Grid district id
143
    gens_id = Column(String, nullable=True)  # EinheitMastrNummer
144
145
    status = Column(String, nullable=True)  # EinheitBetriebsstatus
146
    commissioning_date = Column(DateTime, nullable=True)  # Inbetriebnahmedatum
147
    postcode = Column(String(5), nullable=True)  # Postleitzahl
148
    city = Column(String(50), nullable=True)  # Ort
149
    municipality = Column(String, nullable=True)  # Gemeinde
150
    federal_state = Column(String(31), nullable=True)  # Bundesland
151
    zip_and_municipality = Column(String, nullable=True)
152
153
    plant_type = Column(String(39), nullable=True)  # ArtDerWasserkraftanlage
154
    water_origin = Column(String(20), nullable=True)  # ArtDesZuflusses
155
156
    capacity = Column(Float, nullable=True)  # Nettonennleistung
157
    feedin_type = Column(String(47), nullable=True)  # Einspeisungsart
158
    voltage_level = Column(Integer, nullable=True)
159
    voltage_level_inferred = Column(Boolean, nullable=True)
160
161
    geometry_geocoded = Column(Boolean)
162
    geom = Column(Geometry("POINT", 4326), index=True, nullable=True)
163
164
165
class EgonPowerPlantsCombustion(Base):