Skip to main content

modeller_schemas

Config YAML specification classes related to modeller/task configuration.

Classes

DataStructureAssignConfig

class DataStructureAssignConfig(    target: Optional[Union[str, list[str]]] = None,    image_cols: Optional[list[str]] = None,    image_prefix: Optional[str] = None,):

Configuration for the datastructure assign argument.

Variables

  • static image_cols : Optional[list[str]]
  • static image_prefix : Optional[str]
  • static target : Union[str, list[str], ForwardRef(None)]

DataStructureConfig

class DataStructureConfig(    table_config: Optional[DataStructureTableConfig] = None,    assign: DataStructureAssignConfig = DataStructureAssignConfig(target=None, image_cols=None, image_prefix=None),    select: DataStructureSelectConfig = DataStructureSelectConfig(include=None, include_prefix=None, exclude=None),    transform: DataStructureTransformConfig = DataStructureTransformConfig(dataset=None, batch=None, image=None, auto_convert_grayscale_images=True),    data_split: Optional[DataSplitConfig] = None,    schema_requirements: SCHEMA_REQUIREMENTS_TYPES = 'partial',    compatible_datasources: list[str] = ['CSVSource', 'DICOMSource', 'ImageSource', 'InterMineSource', 'NIFTISource', 'DICOMOphthalmologySource', 'HeidelbergSource', 'TopconSource'],    filter: Optional[list[TaskFilterConfig]] = None,):

Configuration for the modeller schema and dataset options.

Variables

  • static compatible_datasources : list[str]
  • static schema_requirements : Union[Literal['empty', 'partial', 'full'], Dict[Literal['empty', 'partial', 'full'], Any]]

DataStructureSelectConfig

class DataStructureSelectConfig(    include: Optional[list[str]] = None,    include_prefix: Optional[str] = None,    exclude: Optional[list[str]] = None,):

Configuration for the datastructure select argument.

Variables

  • static exclude : Optional[list[str]]
  • static include : Optional[list[str]]
  • static include_prefix : Optional[str]

DataStructureTableConfig

class DataStructureTableConfig(    table: Union[str, dict[str, str]],    schema_types_override: Optional[Union[SchemaOverrideMapping, Mapping[str, SchemaOverrideMapping]]] = None,):

Configuration for the datastructure table arguments. Deprecated.

Variables

  • static table : Union[str, dict[str, str]]

DataStructureTransformConfig

class DataStructureTransformConfig(    dataset: Optional[list[dict[str, _JSONDict]]] = None,    batch: Optional[list[dict[str, _JSONDict]]] = None,    image: Optional[list[dict[str, _JSONDict]]] = None,    auto_convert_grayscale_images: bool = True,):

Configuration for the datastructure transform argument.

Variables

  • static auto_convert_grayscale_images : bool
  • static batch : Optional[list[dict[str, dict[str, typing.Any]]]]
  • static dataset : Optional[list[dict[str, dict[str, typing.Any]]]]
  • static image : Optional[list[dict[str, dict[str, typing.Any]]]]

ModellerConfig

class ModellerConfig(    pods: PodsConfig,    task: TaskConfig,    secrets: Optional[APIKeys | RefreshableJWT | dict[SecretsUse, APIKeys | RefreshableJWT]] = None,    modeller: ModellerUserConfig = ModellerUserConfig(username='_default', identity_verification_method='oidc-device-code', private_key_file=None),    hub: HubConfig = HubConfig(url='https://hub.bitfount.com'),    message_service: MessageServiceConfig = MessageServiceConfig(url='messaging.bitfount.com', port=443, tls=True, use_local_storage=False),    version: Optional[str] = None,    project_id: Optional[str] = None,    run_on_new_data_only: bool = False,    batched_execution: Optional[bool] = None,    test_run: bool = False,    force_rerun_failed_files: bool = True,    enable_anonymized_tracker_upload: bool = False,    requires_ehr_connection: bool = False,    supports_mps: Optional[bool] = None,):

Full configuration for the modeller.

Variables

  • static batched_execution : Optional[bool]
  • static enable_anonymized_tracker_upload : bool
  • static force_rerun_failed_files : bool
  • static project_id : Optional[str]
  • static requires_ehr_connection : bool
  • static run_on_new_data_only : bool
  • static supports_mps : Optional[bool]
  • static test_run : bool
  • static version : Optional[str]

ModellerUserConfig

class ModellerUserConfig(    username: str = '_default',    identity_verification_method: str = 'oidc-device-code',    private_key_file: Optional[Path] = None,):

Configuration for the modeller.

Arguments

  • username: The username of the modeller. This can be picked up automatically from the session but can be overridden here.
  • identity_verification_method: The method to use for identity verification. Accepts one of the values in IDENTITY_VERIFICATION_METHODS, i.e. one of key-based, oidc-auth-code or oidc-device-code.
  • private_key_file: The path to the private key file for key-based identity verification.

Variables

  • static identity_verification_method : str
  • static username : str

PodsConfig

class PodsConfig(identifiers: list[str]):

Configuration for the pods to use for the modeller.

Variables

  • static identifiers : list[str]

TaskConfig

class TaskConfig(    protocol: Union[ProtocolConfig._get_subclasses()],    algorithm: Union[Union[AlgorithmConfig._get_subclasses()], list[Union[AlgorithmConfig._get_subclasses()]]],    data_structure: DataStructureConfig,    aggregator: Optional[AggregatorConfig] = None,    transformation_file: Optional[Path] = None,    primary_results_path: Optional[str] = None,):

Configuration for the task.

Arguments

  • protocol: The protocol configuration for the task.
  • algorithm: The algorithm(s) to run for this task.
  • data_structure: The data structure configuration.
  • aggregator: Optional aggregator configuration.
  • transformation_file: Optional path to a transformation file.
  • primary_results_path: Optional path for primary results.

Variables

  • static primary_results_path : Optional[str]

TaskExecutionConfig

class TaskExecutionConfig(    run_on_new_data_only: bool = False,    batched_execution: bool = False,    test_run: bool = False,    force_rerun_failed_files: bool = True,    requires_ehr_connection: bool = False,    supports_mps: Optional[bool] = None,):

Execution flags extracted from a ModellerConfig.

Bundles the run-time flags that travel alongside the Modeller so that callers of setup_modeller_from_config do not need to unpack a wide tuple.

Variables

  • static batched_execution : bool
  • static force_rerun_failed_files : bool
  • static requires_ehr_connection : bool
  • static run_on_new_data_only : bool
  • static supports_mps : Optional[bool]
  • static test_run : bool

TaskFilterConfig

class TaskFilterConfig(    filter_type: str, value: Union[Date, DateTD, int, float, bool, list[str], str],):

Configuration for a single task-level filter.

Arguments

  • filter_type: The type of filter (kebab-case string matching TaskFilterType).

  • value: The filter value. Can be a templated string (e.g., "{{ variable }}")

    or an actual value. Type depends on filter_type:

    • file-creation-min-date, file-creation-max-date, file-modification-min-date, file-modification-max-date, min-dob, max-dob, scan-acquisition-min-date,
  • scan-acquisition-max-date: dict with year (required), month (optional), day (optional)

    • min-file-size, max-file-size: float (MB)
    • min-frames, max-frames: int
    • check-required-fields: bool to enable required field checking
    • required-field-names: list[str] of field names to check
    • modality: str, either "OCT" or "SLO"
    • series-description: str
    • inferred-scan-type: str

Variables

  • static filter_type : str
  • static value : Union[DateDateTD, int, float, bool, list[str], str]

TemplatedModellerConfig

class TemplatedModellerConfig(    pods: PodsConfig,    task: TaskConfig,    secrets: Optional[APIKeys | RefreshableJWT | dict[SecretsUse, APIKeys | RefreshableJWT]] = None,    modeller: ModellerUserConfig = ModellerUserConfig(username='_default', identity_verification_method='oidc-device-code', private_key_file=None),    hub: HubConfig = HubConfig(url='https://hub.bitfount.com'),    message_service: MessageServiceConfig = MessageServiceConfig(url='messaging.bitfount.com', port=443, tls=True, use_local_storage=False),    version: Optional[str] = None,    project_id: Optional[str] = None,    run_on_new_data_only: bool = False,    batched_execution: Optional[bool] = None,    test_run: bool = False,    force_rerun_failed_files: bool = True,    enable_anonymized_tracker_upload: bool = False,    requires_ehr_connection: bool = False,    supports_mps: Optional[bool] = None,    template: Optional[dict[str, TemplateVariablesEntryString | TemplateVariablesEntryNumber | TemplateVariablesEntryArray | TemplateVariablesEntryFilePath | TemplateVariablesEntryModelSlug | TemplateVariablesEntrySchemaColumnName | TemplateVariablesEntrySchemaColumnNameArray | TemplateVariablesEntryBool | TemplateVariablesEntryTaskFilters]] = None,):

Schema for task templates.