Details
-
Type:
RFC
-
Status: Implemented
-
Resolution: Done
-
Component/s: DM
-
Labels:None
Description
In the wake of DM-30649 (and the changes described in this Community post), I'd like to update lsst.verify.MetricTask to make use of the new workflow infrastructure. This would be a breaking change to the MetricTask API, affecting metric implementations throughout Science Pipelines.
Currently, lsst.verify.MetricTask has the following specification:
- All metric inputs are considered optional, and the run method must handle None values. (Not clear if this was actually possible before
DM-30649, but it does get unit tested.) - Errors in analysis must raise MetricComputationError.
- Metrics that are not applicable to the data (including because of missing data) must return None instead of raising.
The handling of this nonstandard interface is currently done by MetricTask.runQuantum, which forces a lot of boilerplate on metric developers who need to override runQuantum themselves.
I would like to redesign MetricTask to have the following specification:
- Metric tasks may assume that all their inputs be not None, like ordinary PipelineTasks. Supporting optional inputs is discouraged because it interferes with metrics from being attached to other pipelines (see discussion below).
- Errors in analysis must raise MetricComputationError.
- Metrics that are not applicable to the data must raise NoWorkFound.
This specification change will require changes to all MetricTask implementations. I think the only change that requires a deprecation period is the replacement of None output with NoWorkFound. This can be handled in most cases with a deprecation warning emitted by MetricTask.runQuantum, though tasks that override runQuantum will miss the warning. Per discussion below, there is no need for a deprecation period, as the Middleware framework already provides the desired fallback behavior.
Escalating as a deprecation request.