PIbd-42_SSPR/db/models/ch_experimentdb_experiment_data_model.py

27 lines
1.0 KiB
Python
Raw Normal View History

from clickhouse_sqlalchemy import engines
from clickhouse_sqlalchemy.types import Float64, String
from sqlalchemy import Integer
from sqlalchemy.orm import Mapped, mapped_column
from db.clickhouse_db_connection import BaseClickhouse
class ChExperimentDBExperimentData(BaseClickhouse):
__tablename__ = 'experiment_data'
__table_args__ = (
engines.MergeTree(order_by='id'),
)
2024-10-14 19:49:54 +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):
return f"<ChExperimentDBExperimentData id={self.id}, volume={self.volume}>"