| Total Complexity | 0 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 2 | DB tables / SQLAlchemy ORM classes for heavy duty transport. |
||
| 3 | """ |
||
| 4 | |||
| 5 | from geoalchemy2 import Geometry |
||
| 6 | from sqlalchemy import Column, Float, ForeignKey, String |
||
| 7 | from sqlalchemy.ext.declarative import declarative_base |
||
| 8 | |||
| 9 | from egon.data import config |
||
| 10 | from egon.data.datasets.scenario_parameters import EgonScenario |
||
| 11 | |||
| 12 | Base = declarative_base() |
||
| 13 | DATASET_CFG = config.datasets()["mobility_hgv"] |
||
| 14 | |||
| 15 | |||
| 16 | class EgonHeavyDutyTransportVoronoi(Base): |
||
| 17 | """ |
||
| 18 | Class definition of table demand.egon_heavy_duty_transport_voronoi. |
||
| 19 | """ |
||
| 20 | __tablename__ = "egon_heavy_duty_transport_voronoi" |
||
| 21 | __table_args__ = {"schema": "demand"} |
||
| 22 | |||
| 23 | nuts3 = Column(String, primary_key=True) |
||
| 24 | geometry = Column(Geometry(srid=DATASET_CFG["tables"]["srid"])) |
||
| 25 | area = Column(Float) |
||
| 26 | truck_traffic = Column(Float) |
||
| 27 | normalized_truck_traffic = Column(Float) |
||
| 28 | hydrogen_consumption = Column(Float) |
||
| 29 | scenario = Column(String, ForeignKey(EgonScenario.name), primary_key=True) |
||
| 30 |