MetricTask#
- class lsst.verify.tasks.MetricTask(**kwargs)#
Bases:
PipelineTaskA base class for tasks that compute one metric from input datasets.
Parameters#
Constructor parameters are the same as for
lsst.pipe.base.PipelineTask.Notes#
In general, both the
MetricTask’s metric and its input data are configurable. Metrics may be associated with a data ID at any level of granularity, including repository-wide.Like
lsst.pipe.base.PipelineTask, this class should be customized by overridingrunand by providing alsst.pipe.base.connectionTypes.Inputfor each parameter ofrun. For requirements that are specific toMetricTask, seerun.Methods Summary
run(**kwargs)Run the MetricTask on in-memory data.
runQuantum(butlerQC, inputRefs, outputRefs)Do Butler I/O to provide in-memory objects for run.
Methods Documentation
- abstract run(**kwargs)#
Run the MetricTask on in-memory data.
Parameters#
- **kwargs
Keyword arguments matching the inputs given in the class config; see
lsst.pipe.base.PipelineTask.runfor more details.
Returns#
- struct
lsst.pipe.base.Struct A
Structcontaining at least the following component:measurement: the value of the metric (lsst.verify.MeasurementorNone). This method is not responsible for adding mandatory metadata (e.g., the data ID); this is handled by the caller.Nonemay be used to indicate that a metric is undefined or irrelevant instead of raisingNoWorkFound.
Raises#
- lsst.verify.tasks.MetricComputationError
Raised if an algorithmic or system error prevents calculation of the metric. Examples include corrupted input data or unavoidable exceptions raised by analysis code. The
MetricComputationErrorshould be chained to a more specific exception describing the root cause.Not having enough data for a metric to be applicable is not an error, and should raise
NoWorkFound(see below) instead of this exception.- lsst.pipe.base.NoWorkFound
Raised if the metric is ill-defined or otherwise inapplicable to the data. Typically this means that the pipeline step or option being measured was not run.
- runQuantum(butlerQC, inputRefs, outputRefs)#
Do Butler I/O to provide in-memory objects for run.
This specialization of runQuantum performs error-handling specific to MetricTasks.