Skip to main content

config_schemas

Dataclasses to hold the configuration details for the runners.

Classes

AccessManagerConfig

class AccessManagerConfig(url: str = 'https://am.bitfount.com'):

Configuration for the access manager.

Variables

  • static url : str

AggregatorConfig

class AggregatorConfig(    secure: bool, weights: Optional[Dict[str, Union[int, float]]] = None,):

Configuration for the Aggregator.

Variables

  • static secure : bool
  • static weights : Optional[Dict[str, Union[int, float]]]

AlgorithmConfig

class AlgorithmConfig(    name: str, arguments: _JSONDict = <factory>, pretrained_file: Optional[Path] = None,):

Configuration for the Algorithm.

Variables

  • static arguments : Dict[str, Any]
  • static name : str

BitfountModelReferenceConfig

class BitfountModelReferenceConfig(    model_ref: Union[Path, str],    model_version: Optional[int] = None,    username: Optional[str] = None,):

Configuration for BitfountModelReference.

Variables

  • static model_version : Optional[int]
  • static username : Optional[str]

DataSplitConfig

class DataSplitConfig(data_splitter: str = 'percentage', args: _JSONDict = <factory>):

Configuration for the data splitter.

Variables

  • static args : Dict[str, Any]
  • static data_splitter : str

DataStructureAssignConfig

class DataStructureAssignConfig(    target: Union[str, List[str]],    image_cols: Optional[List[str]] = None,    loss_weights_col: Optional[str] = None,    multihead_col: Optional[str] = None,    ignore_classes_col: Optional[str] = None,):

Configuration for the datastructure assign argument.

Variables

  • static ignore_classes_col : Optional[str]
  • static image_cols : Optional[List[str]]
  • static loss_weights_col : Optional[str]
  • static multihead_col : Optional[str]
  • static target : Union[str, List[str]]

DataStructureConfig

class DataStructureConfig(    table_config: DataStructureTableConfig,    assign: DataStructureAssignConfig,    select: DataStructureSelectConfig = <factory>,    transform: DataStructureTransformConfig = <factory>,):

Configuration for the modeller schema and dataset options.

Variables

DataStructureSelectConfig

class DataStructureSelectConfig(    include: List[str] = <factory>, exclude: List[str] = <factory>,):

Configuration for the datastructure select argument.

Variables

  • static exclude : List[str]
  • static include : List[str]

DataStructureTableConfig

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

Configuration for the datastructure table arguments.

Variables

  • static query : Union[str, Dict[str, str], None]
  • static schema_types_override : Union[Mapping[Literal['categorical', 'continuous', 'image', 'text'], List[Union[str, Mapping[str, Mapping[str, int]]]]], Mapping[str, Mapping[Literal['categorical', 'continuous', 'image', 'text'], List[Union[str, Mapping[str, Mapping[str, int]]]]]], None]
  • static table : Union[str, Dict[str, str], None]

DataStructureTransformConfig

class DataStructureTransformConfig(    dataset: Optional[List[Dict[str, _JSONDict]]] = None,    batch: Optional[List[Dict[str, _JSONDict]]] = None,):

Configuration for the datastructure transform argument.

Variables

  • static batch : Optional[List[Dict[str, Dict[str, Any]]]]
  • static dataset : Optional[List[Dict[str, Dict[str, Any]]]]

DatabaseConfig

class DatabaseConfig(    con: str,    db_schema: Optional[str] = None,    query: Optional[str] = None,    table_names: Optional[List[str]] = None,):

Configuration for the DatabaseConnection.

Methods


def get_db_connection(self)> DatabaseConnection:

Returns a DatabaseConnection.

Variables

  • static con : str
  • static db_schema : Optional[str]
  • static query : Optional[str]
  • static table_names : Optional[List[str]]

HubConfig

class HubConfig(url: str = 'https://hub.bitfount.com'):

Configuration for the hub.

Variables

  • static url : str

ModelConfig

class ModelConfig(    name: Optional[str] = None,    structure: Optional[ModelStructureConfig] = None,    bitfount_model: Optional[BitfountModelReferenceConfig] = None,    hyperparameters: _JSONDict = <factory>,    logger_config: Optional[LoggerConfig] = None,    dp_config: Optional[DPModellerConfig] = None,):

Configuration for the model.

Variables

  • static hyperparameters : Dict[str, Any]
  • static name : Optional[str]

ModelStructureConfig

class ModelStructureConfig(name: str, arguments: _JSONDict = <factory>):

Configuration for the ModelStructure.

Variables

  • static arguments : Dict[str, Any]
  • static name : str

ModellerConfig

class ModellerConfig(    pods: PodsConfig,    data_structure: DataStructureConfig,    task: TaskConfig,    modeller: ModellerUserConfig = <factory>,    hub: HubConfig = <factory>,    message_service: MessageServiceConfig = <factory>,):

Full configuration for the modeller.

Variables

ModellerUserConfig

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

Configuration for the modeller.

Variables

  • static identity_provider_url : Optional[str]
  • static identity_verification_method : str
  • static username : str

PathConfig

class PathConfig(path: Path):

Configuration for the path.

Variables

PodConfig

class PodConfig(    datasource: str,    data_config: PodDataConfig,    api_key: Optional[APIKeys] = None,    pod_name: str = <fields.String(dump_default=<marshmallow.missing>, attribute=None, validate=<Regexp(regex=re.compile('[a-z\\d]+((-|_)[a-z\\d]+)*'), error='String does not match expected pattern.')>, required=False, load_only=False, dump_only=False, load_default=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>,    pod_details: Optional[PodDetailsConfig] = None,    schema: Optional[Path] = None,    access_manager: AccessManagerConfig = <factory>,    hub: HubConfig = <factory>,    message_service: MessageServiceConfig = <factory>,    differential_privacy: Optional[DPPodConfig] = None,    other_pods: Optional[List[str]] = None,    username: str = '_default',):

Full configuration for the pod.

Raises

  • ValueError: If a username is not provided alongside API keys.

Variables

  • static api_key : Optional[APIKeys]
  • static datasource : str
  • static other_pods : Optional[List[str]]
  • static pod_name : str
  • static username : str
  • pod_id : str - The pod ID of the pod specified.

PodDataConfig

class PodDataConfig(    force_stypes: Optional[Mapping[str, MutableMapping[_SemanticTypeValue, List[str]]]] = None,    ignore_cols: Optional[List[str]] = None,    modifiers: Optional[Dict[str, DataPathModifiers]] = None,    datasource_args: _JSONDict = <factory>,    data_split: DataSplitConfig = <factory>,    auto_tidy: bool = False,):

Configuration for the Schema, BaseSource and Pod.

Arguments

  • force_stypes: The semantic types to force for the data. This is passed to the BitfountSchema.
  • ignore_cols: The columns to ignore. This is passed to the data source.
  • modifiers: The modifiers to apply to the data. This is passed to the BaseSource.
  • datasource_args: Key-value pairs of arguments to pass to the data source constructor.
  • data_split: The data split configuration. This is passed to the data source.
  • auto_tidy: Whether to automatically tidy the data. This is used by the Pod and will result in removal of NaNs and normalisation of numeric values. Defaults to False.

Variables

  • static auto_tidy : bool
  • static datasource_args : Dict[str, Any]
  • static force_stypes : Optional[Mapping[str, MutableMapping[Literal['categorical', 'continuous', 'image', 'text'], List[str]]]]
  • static ignore_cols : Optional[List[str]]

PodDetailsConfig

class PodDetailsConfig(display_name: str, description: str):

Configuration for the pod details.

Arguments

  • display_name: The display name of the pod.
  • description: The description of the pod.

Variables

  • static description : str
  • static display_name : str

PodsConfig

class PodsConfig(identifiers: List[str]):

Configuration for the pods to use for the modeller.

Variables

  • static identifiers : List[str]

ProtocolConfig

class ProtocolConfig(name: str, arguments: _JSONDict = <factory>):

Configuration for the Protocol.

Variables

  • static arguments : Dict[str, Any]
  • static name : str

TaskConfig

class TaskConfig(    protocol: ProtocolConfig,    algorithm: AlgorithmConfig,    model: ModelConfig,    aggregator: Optional[AggregatorConfig] = None,    transformation_file: Optional[Path] = None,):

Configuration for the task.

Variables