Specification

class lsst.verify.Specification(name, **kwargs)

Bases: lsst.verify.jsonmixin.JsonSerializationMixin

Specification base class.

Specification classes must implement:

Subclasses should also call Specification.__init__ to initialize the specifications name attribute (a Name instance).

Attributes Summary

json dict that can be serialized as semantic JSON, compatible with the SQUASH metric service.
metric_name Name of the metric this specification corresponds to (lsst.verify.Name).
name Specification name (lsst.verify.Name).
tags Tag labels (set of str).
type Specification type (str).

Methods Summary

check(measurement) Check if a measurement passes this specification.
query_metadata(metadata[, arg_driven]) Query a Job’s metadata to determine if this specification applies.

Attributes Documentation

json

dict that can be serialized as semantic JSON, compatible with the SQUASH metric service.

metric_name

Name of the metric this specification corresponds to (lsst.verify.Name).

name

Specification name (lsst.verify.Name).

tags

Tag labels (set of str).

type

Specification type (str).

Methods Documentation

check(measurement)

Check if a measurement passes this specification.

Parameters:
measurement : astropy.units.Quantity

The measurement value. The measurement Quantity must have units compatible with the specification.

Returns:
passed : bool

True if the measurement meets the specification, False otherwise.

query_metadata(metadata, arg_driven=False)

Query a Job’s metadata to determine if this specification applies.

Parameters:
metadata : lsst.verify.Metadata or dict-type

Metadata mapping. Typically this is the lsst.verify.Job.meta attribute.

arg_driven : bool, optional

If False (default), metadata matches the MetadataQuery if metadata has all the terms defined in MetadataQuery, and those terms match. If metadata has more terms than MetadataQuery, it can still match. This behavior is appropriate for finding if a specification applies to a Job given metadata.

If True, the orientation of the matching is reversed. Now metadata matches the MetadataQuery if MetadataQuery has all the terms defined in metadata and those terms match. If MetadataQuery has more terms than metadata, it can still match. This behavior is appropriate for discovering specifications.

Returns:
matched : bool

True if this specification matches, False otherwise.