pyiron_base.jobs.job.runfunction.execute_command_with_error_handling

pyiron_base.jobs.job.runfunction.execute_command_with_error_handling#

pyiron_base.jobs.job.runfunction.execute_command_with_error_handling(executable: str, shell: bool, working_directory: str, cores: int = 1, threads: int = 1, gpus: int = 1, conda_environment_name: str | None = None, conda_environment_path: str | None = None, accepted_return_codes: List[int] = [], accept_crash: bool = False) Tuple[bool, str][source]#

Execute command including error handling and support for execution in separate conda environment

Parameters:
  • executable (str) – Executable to be executed in the working directory.

  • shell (bool) – The shell parameter from the subprocess.Popen() function of the python standard library.

  • working_directory (str) – Directory the calculation is executed in.

  • conda_environment_name (str) – Name of a conda environment to execute the executable in.

  • conda_environment_path (str) – Path of a conda environment to execute the executable in.

  • accept_crash (bool) – Boolean flag to accept crashes.

  • accepted_return_codes (list) – List of accepted return codes.

Returns:

boolean flag if the execution crashed with an acceptable error and string output of the command line

Return type:

bool, str