Completed
Push — dev ( 85d654...312d71 )
by
unknown
21s queued 16s
created

data.datasets.emobility.motorized_individual_travel_charging_infrastructure.db_classes   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 18
dl 0
loc 32
rs 10
c 0
b 0
f 0
1
"""
2
DB tables / SQLAlchemy ORM classes for charging infrastructure
3
"""
4
5
from geoalchemy2 import Geometry
6
from sqlalchemy import Column, Float, Integer, String
7
from sqlalchemy.ext.declarative import declarative_base
8
9
from egon.data import config
10
11
Base = declarative_base()
12
DATASET_CFG = config.datasets()["charging_infrastructure"]
13
14
15
class EgonEmobChargingInfrastructure(Base):
16
    """
17
    Class definition of table grid.egon_emob_charging_infrastructure.
18
    """
19
20
    __tablename__ = DATASET_CFG["targets"]["charging_infrastructure"]["table"]
21
    __table_args__ = {
22
        "schema": DATASET_CFG["targets"]["charging_infrastructure"]["schema"]
23
    }
24
25
    cp_id = Column(Integer, primary_key=True)
26
    mv_grid_id = Column(Integer)
27
    use_case = Column(String)
28
    weight = Column(Float)
29
    geometry = Column(
30
        Geometry(
31
            srid=DATASET_CFG["original_data"]["sources"]["tracbev"]["srid"]
32
        )
33
    )
34