spawn.runners

Runners for spawn tasks

A runner has a run method, which runs the work required for a task, and a complete method, which returns True when the task has completed.

class spawn.runners.ProcessRunner(id_, input_file_path, exe_path, run_name=None, output_dir=None, cwd=None)[source]

Runner that uses the native os process (provided by subprocess) in order to run tasks

complete()[source]

Determine if the run is complete.

Returns

True if the run is complete; False otherwise.

Return type

bool

error_logs()[source]

Error logs produced by the process, if any

Returns

The output written to stderr, if any, otherwise None

Return type

str

logs()[source]

Stdout logs produced by the process, if any

Returns

The output written to stdout, if any, otherwise None

Return type

str

property output_file_base

The base path of the output file (without extension)

Returns

The path to the output file, without extension.

Return type

path-like

property process_args

The arguments to be provided to the subprocess.

Can be overridden in derived classes.

Returns

An array containing the process arguments

Return type

list

run()[source]

Runs the process synchronously.

Runs the process synchronously and when complete writes the log files and a status file.

property state_file

The path to the state file

Returns

The path to the state file

Return type

path-like