2024-10-25 02:02:31 +04:00
|
|
|
from clickhouse_sqlalchemy import engines
|
|
|
|
from clickhouse_sqlalchemy.types import Float64, String
|
|
|
|
from sqlalchemy import Integer
|
2024-10-18 16:42:39 +04:00
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
2024-10-15 16:34:09 +04:00
|
|
|
|
2024-10-25 02:02:31 +04:00
|
|
|
from db.clickhouse_db_connection import BaseClickhouse
|
2024-10-21 13:25:59 +04:00
|
|
|
|
2024-10-25 02:02:31 +04:00
|
|
|
class ChExperimentDBExperimentData(BaseClickhouse):
|
|
|
|
__tablename__ = 'experiment_data'
|
|
|
|
__table_args__ = (
|
|
|
|
engines.MergeTree(order_by='id'),
|
|
|
|
)
|
2024-10-14 19:49:54 +04:00
|
|
|
|
2024-10-25 02:02:31 +04:00
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
|
|
volume: Mapped[float] = mapped_column(Float64)
|
|
|
|
nitrogen_oxide_emission: Mapped[float] = mapped_column(Float64)
|
|
|
|
temperature: Mapped[float] = mapped_column(Float64)
|
|
|
|
co_fraction: Mapped[float] = mapped_column(Float64)
|
|
|
|
co2_fraction: Mapped[float] = mapped_column(Float64)
|
|
|
|
x: Mapped[float] = mapped_column(Float64)
|
|
|
|
y: Mapped[float] = mapped_column(Float64)
|
|
|
|
z: Mapped[float] = mapped_column(Float64)
|
|
|
|
file_id: Mapped[str] = mapped_column(String)
|
2024-10-14 19:49:54 +04:00
|
|
|
|
|
|
|
def __repr__(self):
|
2024-10-25 02:02:31 +04:00
|
|
|
return f"<ChExperimentDBExperimentData id={self.id}, volume={self.volume}>"
|