Code Duplication    Length = 49-50 lines in 2 locations

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

@@ 806-855 (lines=50) @@
803
    start_time = Column(DateTime)
804
805
806
class EgonPfHvTransformer(Base):
807
808
    source_list = [
809
        sources()["egon-data"],
810
        sources()["openstreetmap"],
811
    ]
812
813
    contributor_list = contributors(["ic", "cb"])
814
    contributor_list[0]["comment"] = "Added transformes from osmTGmod tables"
815
    contributor_list[1]["comment"] = "Added meta data"
816
817
818
    __tablename__ = "egon_etrago_transformer"
819
    __table_args__ = {
820
        "schema": "grid",
821
        "comment": get_meta(
822
            "grid",
823
            "Transformer",
824
            source_list=source_list,
825
            contributor_list=contributor_list,
826
        ),
827
    }
828
829
    scn_name = Column(String, primary_key=True, nullable=False)
830
    trafo_id = Column(BigInteger, primary_key=True, nullable=False)
831
    bus0 = Column(BigInteger)
832
    bus1 = Column(BigInteger)
833
    type = Column(Text)
834
    model = Column((Text), server_default="t")
835
    x = Column((Numeric), server_default="0.")
836
    r = Column((Numeric), server_default="0.")
837
    g = Column((Numeric), server_default="0.")
838
    b = Column((Numeric), server_default="0.")
839
    s_nom = Column(Float(53), server_default="0.")
840
    s_nom_extendable = Column((Boolean), server_default="False")
841
    s_nom_min = Column(Float(53), server_default="0.")
842
    s_nom_max = Column(Float(53), server_default="inf")
843
    s_max_pu = Column(Float(53), server_default="1.")
844
    tap_ratio = Column(Float(53), server_default="1.")
845
    tap_side = Column((BigInteger), server_default="0")
846
    tap_position = Column((BigInteger), server_default="0")
847
    phase_shift = Column(Float(53), server_default="0.")
848
    build_year = Column(BigInteger, server_default="0")
849
    lifetime = Column(Float(53), server_default="inf")
850
    v_ang_min = Column(Float(53), server_default="-inf")
851
    v_ang_max = Column(Float(53), server_default="inf")
852
    capital_cost = Column(Float(53), server_default="0.")
853
    num_parallel = Column(Float(53), server_default="1.")
854
    geom = Column(Geometry("MULTILINESTRING", 4326))
855
    topo = Column(Geometry("LINESTRING", 4326))
856
857
858
class EgonPfHvTransformerTimeseries(Base):
@@ 321-369 (lines=49) @@
318
    marginal_cost = Column(ARRAY(Float(precision=53)))
319
320
321
class EgonPfHvLine(Base):
322
323
    source_list = [
324
        sources()["egon-data"],
325
        sources()["openstreetmap"],
326
    ]
327
328
    contributor_list = contributors(["ic", "cb"])
329
    contributor_list[0]["comment"] = "Added lines from osmTGmod tables"
330
    contributor_list[1]["comment"] = "Added meta data"
331
332
    __tablename__ = "egon_etrago_line"
333
    __table_args__ = {
334
        "schema": "grid",
335
        "comment": get_meta(
336
            "grid",
337
            "Line",
338
            source_list=source_list,
339
            contributor_list=contributor_list,
340
        ),
341
    }
342
343
    scn_name = Column(String, primary_key=True, nullable=False)
344
    line_id = Column(BigInteger, primary_key=True, nullable=False)
345
    bus0 = Column(BigInteger)
346
    bus1 = Column(BigInteger)
347
    type = Column(Text)
348
    carrier = Column(Text)
349
    x = Column(Numeric, server_default="0.")
350
    r = Column(Numeric, server_default="0.")
351
    g = Column(Numeric, server_default="0.")
352
    b = Column(Numeric, server_default="0.")
353
    s_nom = Column(Numeric, server_default="0.")
354
    s_nom_extendable = Column(Boolean, server_default="False")
355
    s_nom_min = Column(Float(53), server_default="0.")
356
    s_nom_max = Column(Float(53), server_default="inf")
357
    s_max_pu = Column(Float(53), server_default="1.")
358
    build_year = Column(BigInteger, server_default="0")
359
    lifetime = Column(Float(53), server_default="inf")
360
    capital_cost = Column(Float(53), server_default="0.")
361
    length = Column(Float(53), server_default="0.")
362
    cables = Column(Integer)
363
    terrain_factor = Column(Float(53), server_default="1.")
364
    num_parallel = Column(Float(53), server_default="1.")
365
    v_ang_min = Column(Float(53), server_default="-inf")
366
    v_ang_max = Column(Float(53), server_default="inf")
367
    v_nom = Column(Float(53))
368
    geom = Column(Geometry("MULTILINESTRING", 4326))
369
    topo = Column(Geometry("LINESTRING", 4326))
370
371
372
class EgonPfHvLineTimeseries(Base):