Algorithms base#

Base class for Algorithms.

Classes:

Algorithm

Base class for Algorithms.

SubprocessAlgorithmMixin

Mixin for running algorithms in a subprocess, to be used with Algorithm.

class Algorithm#

Bases: ABC

Base class for Algorithms.

abstract property name: str#

Name of the algorithm.

class SubprocessAlgorithmMixin#

Bases: ABC

Mixin for running algorithms in a subprocess, to be used with Algorithm.

call_script(cmd_args, env=None, cwd=None)#

Call a (Python) script as a separate process.

Parameters:
  • cmd_args (list[str]) – List of strings that are passed as commandline arguments to the executable.

  • env (dict[str, str] | None) – Environment variables specified as a dictionary; e.g. {"PATH": "/usr/bin"}.

  • cwd (Path | None) – If not None, change working directory to the given path before running command.

Raises:

RuntimeError – If the called script failed or timed out.

Return type:

None

property executable: list[str]#

Path to a (Python) executable.

By default, the Python executable that called this script is used.