DataCoordinateReader

class lsst.daf.butler.registry.queries.DataCoordinateReader

Bases: ABC

Base class and factory for reader objects that extract DataCoordinate instances from query result rows.

Attributes Summary

columns_required

Methods Summary

make(dimensions[, full, records, record_caches])

Construct a concrete reader for a set of dimensions.

read(row)

Read a DataCoordinate from a query result row.

Attributes Documentation

columns_required

Methods Documentation

static make(dimensions: DimensionGraph, full: bool = True, records: bool = False, record_caches: Mapping[DimensionElement, Mapping[DataCoordinate, DimensionRecord]] | None = None) DataCoordinateReader

Construct a concrete reader for a set of dimensions.

Parameters:
dimensionsDimensionGraph

Dimensions of the DataCoordinate instances the new reader will read.

fullbool, optional

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

recordsbool, optional

Whether to attach dimension records.

record_cachesMapping, optional

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

Returns:
readerDataCoordinateReader

Concrete reader instance.

abstract read(row: Mapping[ColumnTag, Any]) DataCoordinate

Read a DataCoordinate from a query result row.

Parameters:
rowMapping

Mapping with ColumnTag keys representing a query result row.

Returns:
data_coordinateDataCoordinate

New data ID.