TaskRunner¶
-
class
lsst.pipe.base.
TaskRunner
¶ Bases:
object
Run a command-line task, using
multiprocessing
if requested.Parameters: - TaskClass :
lsst.pipe.base.Task
subclass The class of the task to run.
- parsedCmd :
argparse.Namespace
The parsed command-line arguments, as returned by the task’s argument parser’s
parse_args
method.Warning
Do not store
parsedCmd
, as this instance is pickled (if multiprocessing) and parsedCmd may contain non-picklable elements. It certainly contains more data than we need to send to each instance of the task.- doReturnResults :
bool
, optional Should run return the collected result from each invocation of the task? This is only intended for unit tests and similar use. It can easily exhaust memory (if the task returns enough data and you call it enough times) and it will fail when using multiprocessing if the returned data cannot be pickled.
Note that even if
doReturnResults
is False a struct with a single member “exitStatus” is returned, with value 0 or 1 to be returned to the unix shell.
Raises: - ImportError
Raised if multiprocessing is requested (and the task supports it) but the multiprocessing library cannot be imported.
Deprecated since version v23.0: Gen2 task runners are no longer supported. This functionality has been disabled.
- TaskClass :