Metadata¶
- class lsst.verify.Metadata(measurement_set, data=None)¶
- Bases: - JsonSerializationMixin- Container for verification framework job metadata. - Metadata are key-value terms. Both keys and values should be JSON-serializable. - Parameters:
- measurement_setlsst.verify.MeasurementSet, optional
- When provided, metadata with keys prefixed by metric names are deferred to - Metadatainstances attached to measurements (- lsst.verify.Measurement.notes).
- datadict, optional
- Dictionary to seed metadata. 
 
- measurement_set
 - Attributes Summary - A - dictthat can be serialized as semantic SQUASH JSON.- Methods Summary - items()- Iterate over key-value metadata pairs. - jsonify_dict(d)- Recursively build JSON-renderable objects on all values in a dict. - keys()- Get the metadata keys. - update(data)- Update metadata with key-value pairs from a - dict-like object.- values()- Iterate over metadata values. - write_json(filepath)- Write JSON to a file. - Attributes Documentation - json¶
- A - dictthat can be serialized as semantic SQUASH JSON.- Keys in the - dictare metadata keys (see- Metadata.keys). Values are the associated metadata values as JSON-serializable objects.
 - Methods Documentation - items()¶
- Iterate over key-value metadata pairs. 
 - static jsonify_dict(d)¶
- Recursively build JSON-renderable objects on all values in a dict. - Parameters:
- ddict
- Dictionary to convert into a JSON-serializable object. Values are recursively JSON-ified. 
 
- d
- Returns:
- json_dictdict
- Dictionary that can be serialized to JSON. 
 
- json_dict
 - 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, }) 
 - keys()¶
- Get the metadata keys. 
 - update(data)¶
- Update metadata with key-value pairs from a - dict-like object.- Parameters:
- datadict-like
- The - dataobject needs to provide an- itemsmethod to iterate over its key-value pairs. If this- Metadatainstance already has a key, the value will be overwritten with the value from- data.
 
- data
 
 - values()¶
- Iterate over metadata values. - Returns:
- itemsValuesView
- An iterable over all the values. 
 
- items