TopologicalSet¶
-
class
lsst.daf.butler.core.utils.TopologicalSet(elements)¶ Bases:
collections.abc.SetA collection that behaves like a builtin
set, but where elements can be interconnected (like a graph).Iteration over this collection visits its elements in topologically sorted order.
Parameters: - elements : Iterable
Any iterable with elements to insert.
Methods Summary
connect(sourceElement, targetElement)Connect two elements in the set. isdisjoint(other)Return True if two sets have a null intersection. Methods Documentation
-
connect(sourceElement, targetElement)¶ Connect two elements in the set.
The connection is directed from
sourceElementtotargetElementand is distinct from its inverse. Both elements must already be present in the set.Raises: - KeyError
When either element is not already in the set.
- ValueError
If a self connections between elements would be created.
-
isdisjoint(other)¶ Return True if two sets have a null intersection.