Utilities

IO-Tools

Tools for input and output.

class pylhc_submitter.utils.iotools.PathOrStr(value)[source]

A class that behaves like a Path when possible, otherwise like a string.

pylhc_submitter.utils.iotools.convert_paths_in_dict_to_strings(dict_: dict) dict[source]

Converts all Paths in the dict to strings, including those in iterables.

pylhc_submitter.utils.iotools.escape_percentage_signs(dict_: dict) dict[source]

Escape all percentage signs. They are used for interpolation in the config-parser.

pylhc_submitter.utils.iotools.keys_to_path(dict_, *keys)[source]

Convert all keys to Path, if they are not None.

pylhc_submitter.utils.iotools.make_replace_entries_iterable(replace_dict: dict) dict[source]

Makes all entries in replace-dict iterable.

pylhc_submitter.utils.iotools.save_config(output_dir: Path, opt: dict, script: str)[source]

Quick wrapper for save_options_to_config.

Parameters:
  • output_dir (Path) -- Path to the output directory (does not need to exist).

  • opt (dict) -- opt-structure to be saved.

  • script (str) -- path/name of the invoking script (becomes name of the .ini) usually __file__.

Logging Tools

Tools that make the logging life easier.

pylhc_submitter.utils.logging_tools.log_setup()[source]

Set up a basic logger.