Source code for app.model.orm.custom_model
from datetime import datetime
import sqlalchemy as sql
from sqlalchemy.orm import (
Mapped,
mapped_column,
relationship,
validates,
)
from sqlalchemy_utc.sqltypes import UtcDateTime
from app.model.orm.orm_base import OrmBase
from app.model.lib.modeling import (
ALL_COEFFICIENTS,
FIT_PARAMETERS,
)
[docs]
class CustomModel(OrmBase):
"""
The description of a user-created model type.
"""
@property
[docs]
def coefficientInfo(self):
return [
{'name': name, **ALL_COEFFICIENTS[name]}
for name in self.coefficientNames
]
@property
[docs]
def fitInfo(self):
return [
{'name': name, **FIT_PARAMETERS[name]}
for name in self.fitNames
]