v2
model_inferences record, v2 — canonical aliases.
Consumers and the record registry import from here and never touch the inner
module names, mirroring steps/*/v1/__init__.py.
v2 adds the nullable source_file_hash column — see schema.py.
Module
Submodules
- bitfount.cache.types.model_inferences.v2.migrations - Autogenerated migration for
model_inferencesv1 -> v2. - bitfount.cache.types.model_inferences.v2.model - Pydantic record for the
model_inferencescache table (v2). - bitfount.cache.types.model_inferences.v2.schema - SQLAlchemy ORM for the
model_inferencescache table (v2). - bitfount.cache.types.model_inferences.v2.store - Model inference store.
Functions
downgrade
def downgrade(op: Operations) ‑> None:Migrate model_inferences v2 -> v1 (see the module docstring).
upgrade
def upgrade(op: Operations) ‑> None:Migrate model_inferences v1 -> v2 (see the module docstring).
Classes
ORM
class ORM(**kwargs):SQLAlchemy model for the model_inferences cache table.
A single table for all model inference results. The model_ref
column distinguishes which model produced the inferences (e.g.
"FoveaCenterLandmarkDetectionModel", "AltrisConfigurablePathologyModel").
Because different models produce different output columns (and some,
like Altris, are configurable at runtime), the actual inference data
is stored as a JSON blob in inferences_json.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in kwargs.
Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.
Ancestors
Variables
-
error : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
file_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
inferences_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
last_accessed_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
model_ref : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
model_version : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
processed_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
project_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
row_number : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
run_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
source_file_hash : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
tags : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
task_hash : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
Record
class Record(**data: Any):Record of a single row from the model_inference table.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Variables
- static
error : str | None
- static
file_id : str
- static
inferences_json : dict[str, typing.Any] | None
- static
last_accessed_at : datetime.datetime | None
- static
model_config
- static
model_ref : str
- static
model_version : int
- static
processed_at : datetime.datetime
- static
project_id : str | None
- static
row_number : int | None
- static
run_id : str | None
- static
source_file_hash : str | None
- static
tags : dict[str, typing.Any] | None
- static
task_hash : str