22 """Module defining TaskFactory interface. 25 __all__ = [
"TaskFactory"]
27 from abc
import ABCMeta, abstractmethod
31 """Abstract base class for task factory. 33 Task factory is responsible for importing PipelineTask subclasses by 34 name and creating instances of these classes. 39 """Locate and import PipelineTask class. 41 Returns tuple of task class and its full name, `None` is returned 42 for both if loading fails. 47 Name of the PipelineTask class, interpretation depends entirely on 48 activator, e.g. it may or may not include dots. 53 PipelineTask class object, or None on failure. 55 Full task class name including package and module, or None on 61 Raised if task class cannot be imported. 63 Raised if imported class is not a PipelineTask. 67 def makeTask(self, taskClass, config, overrides, butler):
68 """Create new PipelineTask instance from its class. 73 `PipelineTask` sub-class. 74 config : `pex.Config` or `None` 75 Configuration object, if `None` then use task-defined 76 configuration class (``taskClass.ConfigClass``) to create new 78 overrides : `ConfigOverrides` or `None` 79 Configuration overrides, this should contain all overrides to be 80 applied to a default task config, including instrument-specific, 81 obs-package specific, and possibly command-line overrides. This 82 parameter is exclusive with ``config``, only one of the two can be 83 specified as not-`None`. 84 butler : `~lsst.daf.butler.Butler` or None 85 Butler instance used to obtain initialization inputs for 86 PipelineTasks. If `None`, some PipelineTasks will not be usable 91 Instance of a `PipelineTask` class or `None` on errors. 95 Any exceptions that are raised by PipelineTask constructor or its 96 configuration class are propagated back to caller. def makeTask(self, taskClass, config, overrides, butler)
def loadTaskClass(self, taskName)