Specification¶
- 
class lsst.validate.base.Specification(name, quantity, unit=None, filter_names=None, dependencies=None)[source]¶
- Bases: - lsst.validate.base.QuantityAttributeMixin,- lsst.validate.base.jsonmixin.JsonSerializationMixin- A specification level, or threshold, associated with a - Metric.- Parameters: - name : - str- Name of the specification level for a metric. LPM-17, for example, uses - 'design',- 'minimum'and- 'stretch'terminology.- quantity : - astropy.units.Quantity,- float, or- int- The specification threshold level. - unit : - str, optional- astropy.units.Unit-compatible- strdescribing the units of- value(only necessary if- quantityis a- float). An empty string (- '') describes a unitless quantity.- filter_names : - list, optional- A list of optical filter names that this specification applies to. Set only if the specification level is dependent on the filter. - dependencies : - dict, optional- A dictionary of named - Datumvalues that must be known when making a measurement against a specification level. Dependencies can be accessed as attributes of the specification object. The names of class attributes match keys in- dependencies.- Attributes Summary - datum- Representation of this - Specificationas a- Datum.- dependencies- dictof named- Datumvalues that must be known when making a- filter_names- listof names of optical filters that this Specification level- json- dictthat can be serialized as semantic JSON, compatible with- latex_unit- Units as a LaTeX string, wrapped in - $.- name- Name of the specification level for a metric. - quantity- The specification threshold level ( - astropy.units.Quantity).- unit- Read-only - astropy.units.Unitof the- quantity.- unit_str- Read-only - astropy.units.Unit-compatible- strindicating units of- quantity.- Methods Summary - from_json(json_data)- Construct a Specification from a JSON document. - jsonify_dict(d)- Recursively build JSON-renderable objects on all values in a dict. - write_json(filepath)- Write JSON to a file. - Attributes Documentation - 
datum¶
- Representation of this - Specificationas a- Datum.
 - 
dependencies= None¶
- dictof named- Datumvalues that must be known when making a measurement against a specification level.- Dependencies can also be accessed as attributes of the - Specificationobject. The names of class attributes match keys in- dependencies.
 - 
filter_names= None¶
- listof names of optical filters that this Specification level applies to.- Default is - Noneif the- Specificationis filter-independent.
 - 
latex_unit¶
- Units as a LaTeX string, wrapped in - $.
 - 
name= None¶
- Name of the specification level for a metric. - LPM-17, for example, uses - 'design',- 'minimum'and- 'stretch'terminology.
 - 
quantity= None¶
- The specification threshold level ( - astropy.units.Quantity).
 - 
unit¶
- Read-only - astropy.units.Unitof the- quantity.
 - 
unit_str¶
- Read-only - astropy.units.Unit-compatible- strindicating units of- quantity.
 - Methods Documentation - 
classmethod from_json(json_data)[source]¶
- Construct a Specification from a JSON document. - Parameters: - json_data : - dict- Specification JSON object. - Returns: - specification : - Specification- Specification from JSON. 
 - 
jsonify_dict(d)¶
- Recursively build JSON-renderable objects on all values in a dict. - Parameters: - d : - dict- Dictionary ito convert into a JSON-serializable object. Values are recursively JSON-ified. - Returns: - json_dict : - dict- Dictionary that can be serialized to JSON. - Examples - Subclasses can use this method to prepare output in their - json-method implementation. For example:- def json(self): return JsonSerializationMixin.jsonify_dict({ 'value': self.value, }) 
 
-