BlobSet¶
- class lsst.verify.BlobSet(blobs=None)¶
Bases:
JsonSerializationMixin
A collection of
Blob
s.- Parameters:
- blobs
list
oflsst.verify.Blob
s Blobs to include in the set.
- blobs
Attributes Summary
A
dict
that can be serialized as JSON.Methods Summary
deserialize
([blobs])Create a BlobSet from a parsed JSON dataset.
insert
(blob)Insert a blob into the set.
items
()Iterate over (identifier,
Blob
) pairs in the set.jsonify_dict
(d)Recursively build JSON-renderable objects on all values in a dict.
keys
()Get a sequence of blob identifiers, which are keys to the BlobSet.
values
()Get a new view of the BlobSet's values.
write_json
(filepath)Write JSON to a file.
Attributes Documentation
Methods Documentation
- classmethod deserialize(blobs=None)¶
Create a BlobSet from a parsed JSON dataset.
- insert(blob)¶
Insert a blob into the set.
- Parameters:
- blob
Blob
Blob
to insert into the set. It can be accessed by key from the BlobSet through itsBlob.identifier
string.
- blob
- items()¶
Iterate over (identifier,
Blob
) pairs in the set.- Yields:
- item
tuple
Tuple containing:
Blob.identifier
of theBlob
(str
)Blob
instance
- item
- static jsonify_dict(d)¶
Recursively build JSON-renderable objects on all values in a dict.
- Parameters:
- d
dict
Dictionary to convert into a JSON-serializable object. Values are recursively JSON-ified.
- d
- Returns:
- json_dict
dict
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 a sequence of blob identifiers, which are keys to the BlobSet.
- Returns:
- keyssequence of
str
Sequence of
Blob.identifier
.
- keyssequence of
- values()¶
Get a new view of the BlobSet’s values.
- Returns:
- blobiterable of
lsst.verify.Blob
A collection of
Blob
objects that is updated when this object changes.
- blobiterable of