DatasetRefReader¶
-
class
lsst.daf.butler.registry.queries.
DatasetRefReader
(dataset_type: lsst.daf.butler.core.datasets.type.DatasetType, *, full: bool = True, translate_collection: Optional[collections.abc.Callable[Any, str], None] = None, records: bool = False, record_caches: Optional[collections.abc.Mapping[lsst.daf.butler.core.dimensions._elements.DimensionElement, collections.abc.Mapping[lsst.daf.butler.core.dimensions._coordinate.DataCoordinate, lsst.daf.butler.core.dimensions._records.DimensionRecord]], None] = None)¶ Bases:
object
Reader class that extracts
DatasetRef
objects from query result rows.Parameters: - dataset_type :
DatasetType
Dataset type for extracted references.
- full :
bool
, optional Whether to expect and extract implied dimensions as well as required dimensions.
- translate_collection :
Callable
, optional Callable that returns
str
collection names given collection primary key values. Optional only for registries that use names as primary keys, or ifrun
is always passed toread
.- records :
bool
, optional Whether to attach dimension records to data IDs.
- record_caches :
Mapping
, 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, Any], *, 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: - row :
Mapping
Mapping with
ColumnTag
keys representing a query result row.- run :
str
, optional Name of the
RUN
collection; when provided the run key does not need to be present in the result row, andtranslate_collection
does not need to be provided at construction.- data_id :
DataCoordinate
, optional Data ID; when provided the dimensions do not need to be present in the result row.
- row :
- dataset_type :