MeasurementSet#

class lsst.verify.MeasurementSet(measurements=None)#

Bases: JsonSerializationMixin

A collection of Measurements of Metrics.

MeasurementSet provides a dict-like interface for getting, setting, and iterating over Measurements.

Parameters#

measurementslist of lsst.verify.Measurements

Measurements to include in the set.

Attributes Summary

json

A dict that can be serialized as JSON.

Methods Summary

deserialize([measurements, blob_set, metric_set])

Create a measurement set from a parsed JSON dataset.

insert(measurement)

Insert a measurement into the set.

items()

Iterete over (Name, Measurement) pairs in the set.

keys()

Get a sequence of metric names contained in the measurement set.

refresh_metrics(metric_set)

Refresh Measurement.metric attributes in Measurements contained by this set.

update(other)

Merge another MeasurementSet into this one.

Attributes Documentation

json#

A dict that can be serialized as JSON.

Methods Documentation

classmethod deserialize(measurements=None, blob_set=None, metric_set=None)#

Create a measurement set from a parsed JSON dataset.

Parameters#

measurementslist, optional

A list of Measurement JSON serializations.

blob_setBlobSet, optional

A BlobSet instance that support measurement deserialization.

metric_setMetricSet, optional

A MetricSet that supports measurement deserialization. If provided, measurements are validated for unit consistency with metric definitions. Measurement instances also gain a Measurement.metric attribute.

Returns#

instanceMeasurementSet

A MeasurementSet instance.

insert(measurement)#

Insert a measurement into the set.

items()#

Iterete over (Name, Measurement) pairs in the set.

Yields#

itemtuple

Tuple containing:

keys()#

Get a sequence of metric names contained in the measurement set.

Returns#

keyssequence of Name

Sequence of names of metrics for measurements in the set.

refresh_metrics(metric_set)#

Refresh Measurement.metric attributes in Measurements contained by this set.

Parameters#

metric_setMetricSet

Metrics from this set are inserted into corresponding Measurements contained in this MeasurementSet.

Notes#

This method is especially useful for inserting Metric instances into Measurements that weren’t originally created with Metric instances. By including a Metric in a Measurement, the serialized units of a measurment are normalized to the metric’s definition.

See also#

lsst.verify.Job.reload_metrics_package

update(other)#

Merge another MeasurementSet into this one.

Parameters#

otherMeasurementSet

Another MeasurementSet. Measurements in other that do exist in this set are added to this one. Measurements in other replace measurements of the same metric in this one.