Skip to main content

v3

model_inferences record, v3 — canonical aliases.

Consumers and the record registry import from here and never touch the inner module names, mirroring steps/*/v1/__init__.py.

v3 indexes file_id — see schema.py.

Module

Submodules

Functions

downgrade

def downgrade(op: Operations)> None:

Migrate model_inferences v3 -> v2 (see the module docstring).

upgrade

def upgrade(op: Operations)> None:

Migrate model_inferences v2 -> v3 (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.

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 model_config
  • static model_ref : str
  • static model_version : int
  • static project_id : str | None
  • static row_number : int | None
  • static run_id : str | None
  • static source_file_hash : str | None
  • static task_hash : str