Blob¶
-
class
lsst.verify.Blob(name, **datums)[source]¶ Bases:
lsst.verify.jsonmixin.JsonSerializationMixinBlob is a flexible container of data, as
lsst.verify.Datums, that are serializable to JSON.Parameters: name :
strName of this type of blob. Blobs from one pipeline Job execution to another that share the same name generally share the same schema of
lsst.verify.Datums.datums :
dictoflsst.verify.Datum-types, optionalAttributes Summary
identifierUnique UUID4-based identifier for this blob ( str).jsonJob data as a JSON-serializable dict.nameName of this blob ( str).Methods Summary
deserialize([identifier, name, data])Deserialize fields from a blob JSON object into a Blobinstance.items()Get pairs of keys and values in the Blob. jsonify_dict(d)Recursively build JSON-renderable objects on all values in a dict. keys()Get keys of blob items. write_json(filepath)Write JSON to a file. Attributes Documentation
Methods Documentation
-
classmethod
deserialize(identifier=None, name=None, data=None)[source]¶ Deserialize fields from a blob JSON object into a
Blobinstance.Parameters: identifier :
strBlob identifier.
name :
strName of the blob type.
data :
dictDictionary of named
name: datum objectkey-value pairs.Returns: blob :
BlobThe
Blobinstance deserialied from a blob JSON object.
-
items()[source]¶ Get pairs of keys and values in the Blob.
Yields: keyval : tuple
Tuple of:
- key (
str) - datum (
lsst.verify.Datum)
- 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, })
-
classmethod