DatasetRefReader

class lsst.daf.butler.registry.queries.DatasetRefReader(dataset_type: DatasetType, *, full: bool = True, translate_collection: Callable[[Any], str] | None = None, records: bool = False, record_caches: Mapping[DimensionElement, Mapping[DataCoordinate, DimensionRecord]] | None = None)

Bases: object

Reader class that extracts DatasetRef objects from query result rows.

Parameters:
dataset_typeDatasetType

Dataset type for extracted references.

fullbool, optional

Whether to expect and extract implied dimensions as well as required dimensions.

translate_collectionCallable, optional

Callable that returns str collection names given collection primary key values. Optional only for registries that use names as primary keys, or if run is always passed to read.

recordsbool, optional

Whether to attach dimension records to data IDs.

record_cachesMapping, optional

Nested mapping (outer keys are dimension element names, inner keys are data IDs for that element) of cached dimension records. Ignored unless records=True.

Attributes Summary

columns_required

Methods Summary

read(row, *[, run, data_id])

Read a DatasetRef from a query result row.

Attributes Documentation

columns_required

Methods Documentation

read(row: Mapping[ColumnTag, Any], *, run: str | None = None, data_id: DataCoordinate | None = None) DatasetRef

Read a DatasetRef from a query result row.

Parameters:
rowMapping

Mapping with ColumnTag keys representing a query result row.

runstr, optional

Name of the RUN collection; when provided the run key does not need to be present in the result row, and translate_collection does not need to be provided at construction.

data_idDataCoordinate, optional

Data ID; when provided the dimensions do not need to be present in the result row.