tardis.utilities.utils module

tardis.utilities.utils.cmd_option_formatter(options: AttributeDict, prefix: str, separator: str) str[source]
tardis.utilities.utils.convert_to(value: ~typing.Any, convert_to_type: ~typing.Callable[[~typing.Any], ~tardis.utilities.utils.T], default: ~typing.Any = <object object>) T[source]
tardis.utilities.utils.csv_parser(input_csv: str, fieldnames: [List, Tuple], delimiter: str = '\t', replacements: dict = None, skipinitialspace: bool = False, skiptrailingspace: bool = False)[source]

Parses CSV formatted input

Parameters
  • input_csv (str) – CSV formatted input

  • fieldnames ([List, Tuple]) – corresponding field names

  • delimiter (str) – delimiter between entries

  • replacements (dict) – fields to be replaced

  • skipinitialspace (bool) – ignore whitespace immediately following the delimiter

  • skiptrailingspace (bool) – ignore whitespace at the end of each csv row

tardis.utilities.utils.disable_logging(level)[source]
tardis.utilities.utils.drone_environment_to_str(drone_environment: ~typing.Dict, seperator: str, prefix: str, customize_key: ~typing.Callable = <function <lambda>>, customize_value: ~typing.Callable = <function <lambda>>) str[source]
tardis.utilities.utils.htcondor_cmd_option_formatter(options: AttributeDict) str[source]
tardis.utilities.utils.load_states(resources)[source]
tardis.utilities.utils.machine_meta_data_translation(machine_meta_data: AttributeDict, meta_data_translation_mapping: AttributeDict)[source]

Helper function to translate units of the machine_meta_data to match the units required by the overlay batch system

Parameters
  • machine_meta_data – Machine Meta Data (Cores, Memory, Disk)

  • meta_data_translation_mapping – Map used for the translation of meta data, contains conversion factors

Returns

Converted meta data with units expected by the OBS

Return type

dict

tardis.utilities.utils.submit_cmd_option_formatter(options: AttributeDict) str[source]