CollectionSummary

class lsst.daf.butler.registry.summaries.CollectionSummary(datasetTypes: NamedValueSet[DatasetType], dimensions: GovernorDimensionRestriction)

Bases: object

A summary of the datasets that can be found in a collection.

Methods Summary

copy()

Return a deep copy of this object.

is_compatible_with(datasetType, restriction)

Test whether the collection summarized by this object should be queried for a given dataset type and governor dimension values.

makeEmpty(universe)

Construct a CollectionSummary for a collection with no datasets.

union(*others)

Construct a summary that contains all dataset types and governor dimension values in any of the inputs.

Methods Documentation

copy() CollectionSummary

Return a deep copy of this object.

Returns:
copyCollectionSummary

A copy of self that can be modified without modifying self at all.

is_compatible_with(datasetType: DatasetType, restriction: GovernorDimensionRestriction, rejections: List[str] | None = None, name: str | None = None) bool

Test whether the collection summarized by this object should be queried for a given dataset type and governor dimension values.

Parameters:
datasetTypeDatasetType

Dataset type being queried. If this collection has no instances of this dataset type (or its parent dataset type, if it is a component), False will always be returned.

restrictionGovernorDimensionRestriction

Restriction on the values governor dimensions can take in the query, usually from a WHERE expression. If this is disjoint with the data IDs actually present in the collection, False will be returned.

rejectionslist [ str ], optional

If provided, a list that will be populated with a log- or exception-friendly message explaining why this dataset is incompatible with this collection when False is returned.

namestr, optional

Name of the collection this object summarizes, for use in messages appended to rejections. Ignored if rejections is None.

Returns:
compatiblebool

True if the dataset query described by this summary and the given arguments might yield non-empty results; False if the result from such a query is definitely empty.

classmethod makeEmpty(universe: DimensionUniverse) CollectionSummary

Construct a CollectionSummary for a collection with no datasets.

Parameters:
universeDimensionUniverse

Object that manages all dimensions.

Returns:
summaryCollectionSummary

Summary object with no dataset types and no governor dimension values.

union(*others: CollectionSummary) CollectionSummary

Construct a summary that contains all dataset types and governor dimension values in any of the inputs.

Parameters:
*othersCollectionSummary

Restrictions to combine with self.

Returns:
unionedCollectionSummary

New summary object that represents the union of self with others.