rl_salamandra_alignment.utils package

Submodules

rl_salamandra_alignment.utils.general module

rl_salamandra_alignment.utils.general.dict_sort(dict_list)[source]

Sorts a list of dictionaries by their string versions

Parameters:

dict_list (list) – list of dictionaries

Returns:

sorted list of dictionaries

Return type:

list

rl_salamandra_alignment.utils.general.try_load_config(config_file)[source]

Load a YAML configuration file as a dictionary.

Parameters: config_file (str): Path to the configuration file.

Returns: dict: Configuration dictionary.

Return type:

dict

rl_salamandra_alignment.utils.general.unfold_dict(input_dict)[source]

Recursively unfolds a dictionary into multiple dictionaries if values are lists. For nested dictionaries, the unfolding continues recursively.

Parameters:

input_dict (dict) – The input dictionary to unfold.

Returns:

A list of dictionaries representing all combinations of the input dictionary’s values.

Return type:

list

rl_salamandra_alignment.utils.job_submission module

Utilities for submitting jobs with SLURM

rl_salamandra_alignment.utils.job_submission.submit_job(job_file, dependency=None)[source]

Function to submit a job and return its job ID :type job_file: str :param job_file: Path to Slurm job file :type job_file: str :type dependency: str :param dependency: job id of dependency for submitting a new job. Defaults to None. :type dependency: str, optional

Returns:

job id of submitted job

Return type:

str

rl_salamandra_alignment.utils.job_submission.submit_job_with_retries(job_file, n_retries)[source]

Submit a slurm job n_retries times with dependencies

Parameters:
  • job_file (str) – Path to Slurm job file

  • n_retries (int) – number of retries

Returns:

job id of last submitted job

Return type:

str

Module contents