CollectionType

class lsst.daf.butler.CollectionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Enumeration used to label different types of collections.

Attributes Summary

CALIBRATION

A CALIBRATION collection operates like a TAGGED collection, but also associates each dataset with a validity range as well.

CHAINED

A CHAINED collection is simply an ordered list of other collections to be searched.

RUN

A RUN collection (also just called a 'run') is the initial collection a dataset is inserted into and the only one it can never be removed from.

TAGGED

Datasets can be associated with and removed from TAGGED collections arbitrarily.

Methods Summary

all()

Return a frozenset containing all members.

from_name(name)

Return the CollectionType given its name.

from_names(names)

Return a frozenset containing the CollectionType instances corresponding to the names.

Attributes Documentation

CALIBRATION = 4

A CALIBRATION collection operates like a TAGGED collection, but also associates each dataset with a validity range as well. Queries against calibration collections must include a timestamp as an input.

It is difficult (perhaps impossible) to enforce a constraint that there be one dataset with a particular dataset type and data ID at any particular timestamp in the database, so higher-level tools that populate calibration collections are expected to maintain that invariant instead.

CHAINED = 3

A CHAINED collection is simply an ordered list of other collections to be searched. These may include other CHAINED collections.

RUN = 1

A RUN collection (also just called a ‘run’) is the initial collection a dataset is inserted into and the only one it can never be removed from.

Within a particular run, there may only be one dataset with a particular dataset type and data ID.

TAGGED = 2

Datasets can be associated with and removed from TAGGED collections arbitrarily.

Within a particular tagged collection, there may only be one dataset with a particular dataset type and data ID.

Methods Documentation

classmethod all() frozenset[lsst.daf.butler.registry._collection_type.CollectionType]

Return a frozenset containing all members.

classmethod from_name(name: str) CollectionType

Return the CollectionType given its name.

Parameters:
namestr

Name of the collection type. Case insensitive.

Returns:
collection_typeCollectionType

The matching collection type.

Raises:
KeyError

Raised if the name does not match a collection type.

classmethod from_names(names: Iterable[str] | None) frozenset[lsst.daf.butler.registry._collection_type.CollectionType]

Return a frozenset containing the CollectionType instances corresponding to the names.

Parameters:
namesiterable of str, or None

Names of collection types. Case insensitive. If None or empty, all collection types will be returned.

Returns:
typesfrozenset of CollectionType

The matching types.

Raises:
KeyError

Raised if the name does not correspond to a collection type.