LSST Applications
22.0.1,22.0.1+01bcf6a671,22.0.1+046ee49490,22.0.1+05c7de27da,22.0.1+0c6914dbf6,22.0.1+1220d50b50,22.0.1+12fd109e95,22.0.1+1a1dd69893,22.0.1+1c910dc348,22.0.1+1ef34551f5,22.0.1+30170c3d08,22.0.1+39153823fd,22.0.1+611137eacc,22.0.1+771eb1e3e8,22.0.1+94e66cc9ed,22.0.1+9a075d06e2,22.0.1+a5ff6e246e,22.0.1+a7db719c1a,22.0.1+ba0d97e778,22.0.1+bfe1ee9056,22.0.1+c4e1e0358a,22.0.1+cc34b8281e,22.0.1+d640e2c0fa,22.0.1+d72a2e677a,22.0.1+d9a6b571bd,22.0.1+e485e9761b,22.0.1+ebe8d3385e
LSST Data Management Base Package
|
Public Member Functions | |
def | runTask (self, task, dataRef, kwargs) |
def | prepareForMultiProcessing (self) |
def | run (self, parsedCmd) |
def | makeTask (self, parsedCmd=None, args=None) |
def | precall (self, parsedCmd) |
def | __call__ (self, args) |
Static Public Member Functions | |
def | getTargetList (parsedCmd, **kwargs) |
Public Attributes | |
TaskClass | |
doReturnResults | |
config | |
log | |
doRaise | |
clobberConfig | |
doBackup | |
numProcesses | |
timeout | |
Static Public Attributes | |
int | TIMEOUT = 3600*24*30 |
A `TaskRunner` for `CmdLineTask`\ s which calls the `Task`\ 's `run` method on a `dataRef` rather than the `runDataRef` method.
Definition at line 498 of file cmdLineTask.py.
|
inherited |
Run the Task on a single target. Parameters ---------- args Arguments for Task.runDataRef() Returns ------- struct : `lsst.pipe.base.Struct` Contains these fields if ``doReturnResults`` is `True`: - ``dataRef``: the provided data reference. - ``metadata``: task metadata after execution of run. - ``result``: result returned by task run, or `None` if the task fails. - ``exitStatus``: 0 if the task completed successfully, 1 otherwise. If ``doReturnResults`` is `False` the struct contains: - ``exitStatus``: 0 if the task completed successfully, 1 otherwise. Notes ----- This default implementation assumes that the ``args`` is a tuple containing a data reference and a dict of keyword arguments. .. warning:: If you override this method and wish to return something when ``doReturnResults`` is `False`, then it must be picklable to support multiprocessing and it should be small enough that pickling and unpickling do not add excessive overhead.
Reimplemented in lsst.pipe.drivers.constructCalibs.CalibTaskRunner.
Definition at line 380 of file cmdLineTask.py.
|
staticinherited |
Get a list of (dataRef, kwargs) for `TaskRunner.__call__`. Parameters ---------- parsedCmd : `argparse.Namespace` The parsed command object returned by `lsst.pipe.base.argumentParser.ArgumentParser.parse_args`. kwargs Any additional keyword arguments. In the default `TaskRunner` this is an empty dict, but having it simplifies overriding `TaskRunner` for tasks whose runDataRef method takes additional arguments (see case (1) below). Notes ----- The default implementation of `TaskRunner.getTargetList` and `TaskRunner.__call__` works for any command-line task whose ``runDataRef`` method takes exactly one argument: a data reference. Otherwise you must provide a variant of TaskRunner that overrides `TaskRunner.getTargetList` and possibly `TaskRunner.__call__`. There are two cases. **Case 1** If your command-line task has a ``runDataRef`` method that takes one data reference followed by additional arguments, then you need only override `TaskRunner.getTargetList` to return the additional arguments as an argument dict. To make this easier, your overridden version of `~TaskRunner.getTargetList` may call `TaskRunner.getTargetList` with the extra arguments as keyword arguments. For example, the following adds an argument dict containing a single key: "calExpList", whose value is the list of data IDs for the calexp ID argument: .. code-block:: python def getTargetList(parsedCmd): return TaskRunner.getTargetList( parsedCmd, calExpList=parsedCmd.calexp.idList ) It is equivalent to this slightly longer version: .. code-block:: python @staticmethod def getTargetList(parsedCmd): argDict = dict(calExpList=parsedCmd.calexp.idList) return [(dataId, argDict) for dataId in parsedCmd.id.idList] **Case 2** If your task does not meet condition (1) then you must override both TaskRunner.getTargetList and `TaskRunner.__call__`. You may do this however you see fit, so long as `TaskRunner.getTargetList` returns a list, each of whose elements is sent to `TaskRunner.__call__`, which runs your task.
Reimplemented in lsst.pipe.tasks.multiBandUtils.MergeSourcesRunner, lsst.pipe.drivers.utils.ButlerTaskRunner, and lsst.pipe.drivers.constructCalibs.CalibTaskRunner.
Definition at line 253 of file cmdLineTask.py.
|
inherited |
Create a Task instance. Parameters ---------- parsedCmd Parsed command-line options (used for extra task args by some task runners). args Args tuple passed to `TaskRunner.__call__` (used for extra task arguments by some task runners). Notes ----- ``makeTask`` can be called with either the ``parsedCmd`` argument or ``args`` argument set to None, but it must construct identical Task instances in either case. Subclasses may ignore this method entirely if they reimplement both `TaskRunner.precall` and `TaskRunner.__call__`.
Reimplemented in lsst.pipe.tasks.multiBandUtils.MergeSourcesRunner, lsst.pipe.drivers.multiBandDriver.MultiBandDriverTaskRunner, and lsst.pipe.base.cmdLineTask.ButlerInitializedTaskRunner.
Definition at line 315 of file cmdLineTask.py.
|
inherited |
Hook for code that should run exactly once, before multiprocessing. Notes ----- Must return True if `TaskRunner.__call__` should subsequently be called. .. warning:: Implementations must take care to ensure that no unpicklable attributes are added to the TaskRunner itself, for compatibility with multiprocessing. The default implementation writes package versions, schemas and configs, or compares them to existing files on disk if present.
Definition at line 349 of file cmdLineTask.py.
|
inherited |
Prepare this instance for multiprocessing Optional non-picklable elements are removed. This is only called if the task is run under multiprocessing.
Definition at line 193 of file cmdLineTask.py.
|
inherited |
Run the task on all targets. Parameters ---------- parsedCmd : `argparse.Namespace` Parsed command `argparse.Namespace`. Returns ------- resultList : `list` A list of results returned by `TaskRunner.__call__`, or an empty list if `TaskRunner.__call__` is not called (e.g. if `TaskRunner.precall` returns `False`). See `TaskRunner.__call__` for details. Notes ----- The task is run under multiprocessing if `TaskRunner.numProcesses` is more than 1; otherwise processing is serial.
Reimplemented in lsst.ctrl.pool.parallel.BatchTaskRunner.
Definition at line 202 of file cmdLineTask.py.
def lsst.pipe.base.cmdLineTask.LegacyTaskRunner.runTask | ( | self, | |
task, | |||
dataRef, | |||
kwargs | |||
) |
Call `run` for this task instead of `runDataRef`. See `TaskRunner.runTask` above for details.
Reimplemented from lsst.pipe.base.cmdLineTask.TaskRunner.
Definition at line 503 of file cmdLineTask.py.
|
inherited |
Definition at line 180 of file cmdLineTask.py.
|
inherited |
Definition at line 177 of file cmdLineTask.py.
|
inherited |
Definition at line 181 of file cmdLineTask.py.
|
inherited |
Definition at line 179 of file cmdLineTask.py.
|
inherited |
Definition at line 176 of file cmdLineTask.py.
|
inherited |
Definition at line 178 of file cmdLineTask.py.
|
inherited |
Definition at line 182 of file cmdLineTask.py.
|
inherited |
Definition at line 175 of file cmdLineTask.py.
|
staticinherited |
Definition at line 171 of file cmdLineTask.py.
|
inherited |
Definition at line 184 of file cmdLineTask.py.