Metadata¶
-
class
lsst.verify.Metadata(measurement_set, data=None)[source]¶ Bases:
lsst.verify.jsonmixin.JsonSerializationMixinContainer for verification framework job metadata.
Metadata are key-value terms. Both keys and values should be JSON-serializable.
Parameters: measurement_set :
lsst.verify.MeasurementSet, optionalWhen provided, metadata with keys prefixed by metric names are deferred to
Metadatainstances attached to measurements (lsst.verify.Measurement.notes).data :
dict, optionalDictionary to seed metadata.
Attributes Summary
jsonA 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 a listof metadata keys.update(data)Update metadata with key-value pairs from a dict-like object.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 (seeMetadata.keys). Values are the associated metadata values as JSON-serializable objects.
Methods Documentation
-
items()[source]¶ Iterate over key-value metadata pairs.
Yields: item :
tupleA metadata item is a tuple of:
- Key (
str). - Value (object).
- Key (
-
jsonify_dict(d)¶ Recursively build JSON-renderable objects on all values in a dict.
Parameters: d :
dictDictionary to convert into a JSON-serializable object. Values are recursively JSON-ified.
Returns: json_dict :
dictDictionary 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, })
-
keys()[source]¶ Get a
listof metadata keys.Returns: These keys keys can be used to access metadata values (like a
dict).
-