Passed
Pull Request — dev (#943)
by
unknown
02:06
created

motorized_individual_travel_charging_infrastructure.db_classes   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 18
dl 0
loc 29
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
    __tablename__ = DATASET_CFG["targets"]["charging_infrastructure"]["table"]
18
    __table_args__ = {
19
        "schema": DATASET_CFG["targets"]["charging_infrastructure"]["schema"]
20
    }
21
22
    cp_id = Column(Integer, primary_key=True)
23
    mv_grid_id = Column(Integer)
24
    use_case = Column(String)
25
    weight = Column(Float)
26
    geometry = Column(
27
        Geometry(
28
            srid=DATASET_CFG["original_data"]["sources"]["tracbev"]["srid"]
29
        )
30
    )
31