Skip to main content

run_templated_modeller

Run a task from a templated yaml config file.

Usage: python -m python -m bitfount.scripts.run_templated_modeller path-to-yaml-config '[missing-default-1, missing-default-2]'

Module

Functions

dict_replace_value

def dict_replace_value(    dictionary: dict[str, Any],    old_value: str,    new_value: Union[str, list[str], dict[str, Any]],)> dict:

Helper function to replace a value in a dictionary.

list_replace_value

def list_replace_value(    lst: list[Any], old_value: str, new_value: Union[str, list[str], dict[str, Any]],)> list:

Helper function to replace a value in a list.

run

def run(    path_to_config_yaml: Union[str, PathLike],    defaults: Optional[list] = None,    require_all_pods: bool = False,    model_out: Path = PosixPath('output-model.pt'),)> None:

Runs a modeller from a config file.

Arguments

  • path_to_config_yaml: Path to the config YAML file.
  • defaults: list of default values to use for templating the config.
  • require_all_pods: Whether to require all pods to accept the task before continuing.
  • model_out: Path to save the model to (if applicable).

setup_templated_modeller_from_config_file

def setup_templated_modeller_from_config_file(    path_to_config_yaml: Union[str, PathLike], defaults: Optional[list] = None,)> tuple:

Creates a modeller from a YAML config file.

Arguments

  • path_to_config_yaml: the path to the config file
  • defaults: list of default values to use for templating the config

Returns A tuple of the created Modeller and the list of pod identifiers to run