ChainedCollectionRecord¶
-
class
lsst.daf.butler.registry.interfaces.
ChainedCollectionRecord
(key: Any, name: str, universe: lsst.daf.butler.core.dimensions._universe.DimensionUniverse)¶ Bases:
lsst.daf.butler.registry.interfaces.CollectionRecord
A subclass of
CollectionRecord
that adds the list of child collections in aCHAINED
collection.Parameters: - key
Unique collection ID, can be the same as
name
ifname
is used for identification. Usually this is an integer or string, but can be other database-specific type.- name :
str
Name of the collection.
Attributes Summary
children
The ordered search path of child collections that define this chain ( CollectionSearch
).Methods Summary
refresh
(manager)Load children from the database, using the given manager to resolve collection primary key values into records. update
(manager, children, flatten)Redefine this chain to search the given child collections. Attributes Documentation
-
children
¶ The ordered search path of child collections that define this chain (
CollectionSearch
).
Methods Documentation
-
refresh
(manager: lsst.daf.butler.registry.interfaces._collections.CollectionManager) → None¶ Load children from the database, using the given manager to resolve collection primary key values into records.
This method exists to ensure that all collections that may appear in a chain are known to the manager before any particular chain tries to retrieve their records from it.
ChainedCollectionRecord
subclasses can rely on it being called sometime after their own__init__
to finish construction.Parameters: - manager :
CollectionManager
The object that manages this records instance and all records instances that may appear as its children.
- manager :
-
update
(manager: lsst.daf.butler.registry.interfaces._collections.CollectionManager, children: lsst.daf.butler.registry.wildcards.CollectionSearch, flatten: bool) → None¶ Redefine this chain to search the given child collections.
This method should be used by all external code to set children. It delegates to
_update
, which is what should be overridden by subclasses.Parameters: - manager :
CollectionManager
The object that manages this records instance and all records instances that may appear as its children.
- children :
CollectionSearch
A collection search path that should be resolved to set the child collections of this chain.
- flatten :
bool
If
True
, recursively flatten out any nestedCHAINED
collections inchildren
first.
Raises: - ValueError
Raised when the child collections contain a cycle.
- manager :