Specification#
- class lsst.verify.Specification(name, **kwargs)#
Bases:
JsonSerializationMixinSpecification base class.
Specification classes must implement:
Subclasses should also call
Specification.__init__to initialize the specificationsnameattribute (aNameinstance).Attributes Summary
dictthat can be serialized as semantic JSON, compatible with the SQUASH metric service.Name of the metric this specification corresponds to (
lsst.verify.Name).Specification name (
lsst.verify.Name).Tag labels (
setofstr).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#
dictthat 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 (
setofstr).
- type#
Specification type (
str).
Methods Documentation
- abstract check(measurement)#
Check if a measurement passes this specification.
Parameters#
- measurement
astropy.units.Quantity The measurement value. The measurement
Quantitymust have units compatible with the specification.
Returns#
- passed
bool Trueif the measurement meets the specification,Falseotherwise.
- measurement
- query_metadata(metadata, arg_driven=False)#
Query a Job’s metadata to determine if this specification applies.
Parameters#
- metadata
lsst.verify.Metadataordict-type Metadata mapping. Typically this is the
lsst.verify.Job.metaattribute.- arg_driven
bool, optional If
False(default),metadatamatches theMetadataQueryifmetadatahas all the terms defined inMetadataQuery, and those terms match. Ifmetadatahas more terms thanMetadataQuery, 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. Nowmetadatamatches theMetadataQueryifMetadataQueryhas all the terms defined inmetadataand those terms match. IfMetadataQueryhas more terms thanmetadata, it can still match. This behavior is appropriate for discovering specifications.
Returns#
- matched
bool Trueif this specification matches,Falseotherwise.
See also#
lsst.verify.MetadataQuery
- metadata