register

lsst.verify.gen2tasks.register(name)

A class decorator that registers a lsst.verify.tasks.MetricTask with a central repository.

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 MetricTask that is to be used with lsst.verify.gen2tasks.MetricsControllerTask.

Examples

The decorator is applied at the class definition:

>>> from lsst.verify.gen2tasks import register
>>> from lsst.verify.tasks import MetricTask
>>> @register("dummy")
... class DummyMetricTask(MetricTask):
...     pass