DatastoreRecordData

class lsst.daf.butler.DatastoreRecordData(records: dict[uuid.UUID, dict[str, list[lsst.daf.butler.core.storedFileInfo.StoredDatastoreItemInfo]]] = <factory>)

Bases: object

A struct that represents a tabular data export from a single datastore.

Methods Summary

from_simple(simple[, universe, registry])

Make an instance of this class from serialized data.

subset(dataset_ids)

Extract a subset of the records that match given dataset IDs.

to_simple([minimal])

Make representation of the object for serialization.

update(other)

Update contents of this instance with data from another instance.

Methods Documentation

classmethod from_simple(simple: SerializedDatastoreRecordData, universe: DimensionUniverse | None = None, registry: Registry | None = None) DatastoreRecordData

Make an instance of this class from serialized data.

Implements SupportsSimple protocol.

Parameters:
datadict

Serialized representation returned from to_simple method.

universeDimensionUniverse, optional

Dimension universe, not used by this method.

registryRegistry, optional

Registry instance, not used by this method.

Returns:
item_infoStoredDatastoreItemInfo

De-serialized instance of StoredDatastoreItemInfo.

subset(dataset_ids: set[uuid.UUID]) DatastoreRecordData | None

Extract a subset of the records that match given dataset IDs.

Parameters:
dataset_idsset [ DatasetId ]

Dataset IDs to match.

Returns:
record_dataDatastoreRecordData or None

None is returned if there are no matching refs.

Notes

Records in the returned instance are shared with this instance, clients should not update or extend records in the returned instance.

to_simple(minimal: bool = False) SerializedDatastoreRecordData

Make representation of the object for serialization.

Implements SupportsSimple protocol.

Parameters:
minimalbool, optional

If True produce minimal representation, not used by this method.

Returns:
simpledict

Representation of this instance as a simple dictionary.

update(other: DatastoreRecordData) None

Update contents of this instance with data from another instance.

Parameters:
otherDatastoreRecordData

Records to merge into this instance.

Notes

If a (dataset_id, table_name) combination has any records in self, it is assumed that all records for that combination are already present. This allows duplicates of the same dataset to be handled gracefully.