registerMultiple¶
-
lsst.verify.gen2tasks.registerMultiple(name)¶ A class decorator that registers a
lsst.verify.tasks.MetricTaskwith a central repository.Unlike
register, this decorator assumes the sameMetricTaskclass will be run bylsst.verify.gen2tasks.MetricsControllerTaskmultiple times with different configs.Parameters: - name :
str The name under which this decorator will register the
MetricTask.
Raises: - RuntimeError
Raised if another class has already been registered under
name.- ValueError
Raised if this decorator is applied to a class that is not a
lsst.verify.tasks.MetricTask.
Notes
This decorator must be used for any
MetricTaskthat will have multiple instances used withlsst.verify.gen2tasks.MetricsControllerTask.The registry entry produced by this decorator corresponds to an anonymous
Configclass with one field,configs.configsis aConfigDictFieldthat may have any number of configs attached to it. The field will create multipleMetricTaskobjects, one for each config provided. SeeMetricsControllerTaskfor an example of how to useconfigs.Examples
The decorator is applied at the class definition:
>>> from lsst.verify.gen2tasks import registerMultiple >>> from lsst.verify.tasks import MetricTask >>> @registerMultiple("reusable") ... class ReusableMetricTask(MetricTask): ... pass
- name :