Total Complexity | 0 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 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 | ) |
||
34 |