ButlerCollections¶
- class lsst.daf.butler.ButlerCollections¶
Bases:
ABC
Methods for working with collections stored in the Butler.
Methods Summary
extend_chain
(parent_collection_name, ...)Add children to the end of a CHAINED collection.
prepend_chain
(parent_collection_name, ...)Add children to the beginning of a CHAINED collection.
redefine_chain
(parent_collection_name, ...)Replace the contents of a CHAINED collection with new children.
remove_from_chain
(parent_collection_name, ...)Remove children from a CHAINED collection.
Methods Documentation
- abstract extend_chain(parent_collection_name: str, child_collection_names: str | Iterable[str]) None ¶
Add children to the end of a CHAINED collection.
If any of the children already existed in the chain, they will be moved to the new position at the end of the chain.
- Parameters:
- Raises:
- MissingCollectionError
If any of the specified collections do not exist.
- CollectionTypeError
If the parent collection is not a CHAINED collection.
- CollectionCycleError
If this operation would create a collection cycle.
Notes
If this function is called within a call to
Butler.transaction
, it will hold a lock that prevents other processes from modifying the parent collection until the end of the transaction. Keep these transactions short.
- abstract prepend_chain(parent_collection_name: str, child_collection_names: str | Iterable[str]) None ¶
Add children to the beginning of a CHAINED collection.
If any of the children already existed in the chain, they will be moved to the new position at the beginning of the chain.
- Parameters:
- Raises:
- MissingCollectionError
If any of the specified collections do not exist.
- CollectionTypeError
If the parent collection is not a CHAINED collection.
- CollectionCycleError
If this operation would create a collection cycle.
Notes
If this function is called within a call to
Butler.transaction
, it will hold a lock that prevents other processes from modifying the parent collection until the end of the transaction. Keep these transactions short.
- abstract redefine_chain(parent_collection_name: str, child_collection_names: str | Iterable[str]) None ¶
Replace the contents of a CHAINED collection with new children.
- Parameters:
- Raises:
- MissingCollectionError
If any of the specified collections do not exist.
- CollectionTypeError
If the parent collection is not a CHAINED collection.
- CollectionCycleError
If this operation would create a collection cycle.
Notes
If this function is called within a call to
Butler.transaction
, it will hold a lock that prevents other processes from modifying the parent collection until the end of the transaction. Keep these transactions short.
- abstract remove_from_chain(parent_collection_name: str, child_collection_names: str | Iterable[str]) None ¶
Remove children from a CHAINED collection.
- Parameters:
- Raises:
- MissingCollectionError
If any of the specified collections do not exist.
- CollectionTypeError
If the parent collection is not a CHAINED collection.
Notes
If this function is called within a call to
Butler.transaction
, it will hold a lock that prevents other processes from modifying the parent collection until the end of the transaction. Keep these transactions short.