StoredMemoryItemInfo

class lsst.daf.butler.datastores.inMemoryDatastore.StoredMemoryItemInfo(timestamp: float, storageClass: StorageClass, parentID: UUID)

Bases: StoredDatastoreItemInfo

Internal InMemoryDatastore Metadata associated with a stored DatasetRef.

Attributes Summary

parentID

ID of the parent DatasetRef if this entry is a concrete composite.

storageClass

StorageClass associated with the dataset.

timestamp

Unix timestamp indicating the time the dataset was stored.

Methods Summary

file_location(factory)

Return the location of artifact.

from_record(record)

Create instance from database record.

from_records(class_name, records)

Convert collection of dictionaries to records.

to_record(**kwargs)

Convert record contents to a dictionary.

to_records(records, **kwargs)

Convert a collection of records to dictionaries.

update(**kwargs)

Create a new class with everything retained apart from the specified values.

Attributes Documentation

parentID: UUID

ID of the parent DatasetRef if this entry is a concrete composite. Not used if the dataset being stored is not a virtual component of a composite

storageClass: StorageClass

StorageClass associated with the dataset.

timestamp: float

Unix timestamp indicating the time the dataset was stored.

Methods Documentation

file_location(factory: LocationFactory) Location

Return the location of artifact.

Parameters:
factoryLocationFactory

Factory relevant to the datastore represented by this item.

Returns:
locationLocation

The location of the item within this datastore.

classmethod from_record(record: Mapping[str, Any]) StoredDatastoreItemInfo

Create instance from database record.

Parameters:
recorddict

The record associated with this item.

Returns:
infoinstance of the relevant type.

The newly-constructed item corresponding to the record.

classmethod from_records(class_name: str, records: Iterable[Mapping[str, Any]]) list[lsst.daf.butler.datastore.stored_file_info.StoredDatastoreItemInfo]

Convert collection of dictionaries to records.

Parameters:
class_namestr

Name of the record class.

recordsIterable [ dict ]

Records in their dictionary representation.

Returns:
infoslist [StoredDatastoreItemInfo]

Sequence of records converted to typed representation.

Raises:
TypeError

Raised if class_name is not a sub-class of StoredDatastoreItemInfo.

to_record(**kwargs: Any) dict[str, Any]

Convert record contents to a dictionary.

Parameters:
**kwargs

Additional items to add to returned record.

classmethod to_records(records: Iterable[StoredDatastoreItemInfo], **kwargs: Any) tuple[str, collections.abc.Iterable[collections.abc.Mapping[str, Any]]]

Convert a collection of records to dictionaries.

Parameters:
recordsIterable [ StoredDatastoreItemInfo ]

A collection of records, all records must be of the same type.

**kwargs

Additional items to add to each returned record.

Returns:
class_namestr

Name of the record class.

recordslist [ dict ]

Records in their dictionary representation.

update(**kwargs: Any) StoredDatastoreItemInfo

Create a new class with everything retained apart from the specified values.

Parameters:
**kwargsMapping

Values to override.

Returns:
updatedStoredDatastoreItemInfo

A new instance of the object with updated values.