Scripts.WorkflowScripts.Workflow_utils module

Scripts.WorkflowScripts.Workflow_utils.run_command(command, error_message='Command failed', working_dir=None)[source]

Run a shell command and exit on failure.

Parameters:
  • command – The shell command to execute (string).

  • error_message – Message to display if the command fails.

  • working_dir – Optional working directory in which to run the command.

Raises:

SystemExit – Exits with code 1 if the command fails.

Scripts.WorkflowScripts.Workflow_utils.run_python_script(script_path, args=None, error_message='Python script failed', working_dir=None)[source]

Execute a Python script with the current interpreter and optional arguments.

Parameters:
  • script_path – Path to the Python script to run.

  • args – List of arguments to pass to the script (defaults to []).

  • error_message – Message to display if execution fails.

  • working_dir – Optional working directory in which to run the script.

Raises:

SystemExit – Exits with code 1 if the script execution fails.

Scripts.WorkflowScripts.Workflow_utils.get_databank_paths(NMLDB_ROOT_PATH)[source]

Retrieve relevant paths from databank.

Parameters:

NMLDB_ROOT_PATH – Root path of the database repository.

Returns:

Dictionary mapping descriptive keys to full paths of databank components.

Return type:

dict

Scripts.WorkflowScripts.Workflow_utils.delete_info_file(info_file_path)[source]

Delete an information file at the specified path, warning on failure.

Parameters:

info_file_path – Path to the info file to be removed.

Raises:

OSError – Prints a warning if the file cannot be deleted.