2024-10-15 00:10:09 +04:00
|
|
|
from typing import Optional
|
2024-10-21 13:25:59 +04:00
|
|
|
|
2024-10-25 02:02:31 +04:00
|
|
|
from sqlalchemy import Identity, ForeignKey
|
2024-10-14 19:49:54 +04:00
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
|
2024-10-21 13:25:59 +04:00
|
|
|
from db.models.base import Base
|
2024-10-18 16:42:39 +04:00
|
|
|
|
|
|
|
|
2024-10-14 19:49:54 +04:00
|
|
|
class ExperimentData(Base):
|
2024-10-14 22:02:08 +04:00
|
|
|
__tablename__ = 'experiment_data'
|
2024-10-14 19:49:54 +04:00
|
|
|
|
2024-10-21 13:25:59 +04:00
|
|
|
id: Mapped[int] = mapped_column(Identity(start=21, cycle=True),
|
|
|
|
primary_key=True)
|
2024-10-14 19:49:54 +04:00
|
|
|
direction: Mapped[float]
|
|
|
|
temperature: Mapped[float]
|
|
|
|
nox: Mapped[float]
|
|
|
|
co2: Mapped[float]
|
|
|
|
co: Mapped[float]
|
2024-10-25 02:02:31 +04:00
|
|
|
file_id: Mapped[Optional[str]] = mapped_column(ForeignKey('experiment_parameters.experiment_hash', ondelete='SET NULL'))
|
2024-10-14 19:49:54 +04:00
|
|
|
|
|
|
|
def __repr__(self):
|
2024-10-21 13:25:59 +04:00
|
|
|
return f"<ExperimentData>"
|