DataCoordinateSet¶
- class lsst.daf.butler.DataCoordinateSet(dataIds: Set[DataCoordinate], *, dimensions: Iterable[str] | DimensionGroup | None = None, hasFull: bool | None = None, hasRecords: bool | None = None, check: bool = True, universe: DimensionUniverse | None = None)¶
- Bases: - _DataCoordinateCollectionBase- Iterable iteration that is set-like. - A - DataCoordinateIterableimplementation that adds some set-like functionality, and is backed by a true set-like object.- Parameters:
- dataIdscollections.abc.Set[DataCoordinate]
- A set of - DataCoordinateinstances, with dimensions equal to- dimensions. If this is a mutable object, the caller must be able to guarantee that it will not be modified by any other holders.
- dimensionsIterable[str],DimensionGroup
- Dimensions identified by all data IDs in the collection. 
- hasFullbool, optional
- If - True, the caller guarantees that- DataCoordinate.hasFullreturns- Truefor all given data IDs. If- False, no such guarantee is made, and- DataCoordinateSet.hasFullwill always return- False. If- None(default),- DataCoordinateSet.hasFullwill be computed from the given data IDs, immediately if- checkis- True, or on first use if- checkis- False.
- hasRecordsbool, optional
- If - True, the caller guarantees that- DataCoordinate.hasRecordsreturns- Truefor all given data IDs. If- False, no such guarantee is made and- DataCoordinateSet.hasRecordswill always return- False. If- None(default),- DataCoordinateSet.hasRecordswill be computed from the given data IDs, immediately if- checkis- True, or on first use if- checkis- False.
- checkbool, optional
- If - True(default) check that all data IDs are consistent with the given- dimensionsand state flags at construction. If- False, no checking will occur.
- universeDimensionUniverse
- Object that manages all dimension definitions. 
 
- dataIds
 - Notes - DataCoordinateSetdoes not formally implement the- collections.abc.Setinterface, because that requires many binary operations to accept any set-like object as the other argument (regardless of what its elements might be), and it’s much easier to ensure those operations never behave surprisingly if we restrict them to- DataCoordinateSetor (sometimes)- DataCoordinateIterable, and in most cases restrict that they identify the same dimensions. In particular:- a - DataCoordinateSetwill compare as not equal to any object that is not a- DataCoordinateSet, even native Python sets containing the exact same elements;
- subset/superset comparison _operators_ ( - <,- >,- <=,- >=) require both operands to be- DataCoordinateSetinstances that have the same dimensions (i.e.- dimensionsattribute);
- issubset,- issuperset, and- isdisjointrequire the other argument to be a- DataCoordinateIterablewith the same dimensions;
- operators that create new sets ( - &,- |,- ^,- -) require both operands to be- DataCoordinateSetinstances that have the same dimensions _and_ the same- dtype;
- named methods that create new sets ( - intersection,- union,- symmetric_difference,- difference) require the other operand to be a- DataCoordinateIterablewith the same dimensions _and_ the same- dtype.
 - In addition, when the two operands differ in the return values of - hasFulland/or- hasRecords, we make no guarantees about what those methods will return on the new- DataCoordinateSet(other than that they will accurately reflect what elements are in the new set - we just don’t control which elements are contributed by each operand).- Methods Summary - difference(other)- Return a new set with all data IDs in this that are not in other. - intersection(other)- Return a new set that contains all data IDs from parameters. - isdisjoint(other)- Test whether there are no data IDs in both - selfand- other.- issubset(other)- Test whether - selfcontains all data IDs in- other.- issuperset(other)- Test whether - othercontains all data IDs in- self.- subset(dimensions)- Return a set whose data IDs identify a subset. - symmetric_difference(other)- Return a new set with all data IDs in either parameters, not both. - toSet()- Transform this iterable into a - DataCoordinateSet.- union(other)- Return a new set that contains all data IDs in either parameters. - Methods Documentation - difference(other: DataCoordinateIterable) DataCoordinateSet¶
- Return a new set with all data IDs in this that are not in other. - Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other.dimensions == self.dimensions.
 
- other
- Returns:
- intersectionDataCoordinateSet
- A new - DataCoordinateSetinstance.
 
- intersection
 
 - intersection(other: DataCoordinateIterable) DataCoordinateSet¶
- Return a new set that contains all data IDs from parameters. - Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other.dimensions == self.dimensions.
 
- other
- Returns:
- intersectionDataCoordinateSet
- A new - DataCoordinateSetinstance.
 
- intersection
 
 - isdisjoint(other: DataCoordinateIterable) bool¶
- Test whether there are no data IDs in both - selfand- other.- Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other._dimensions == self._dimensions.
 
- other
- Returns:
 
 - issubset(other: DataCoordinateIterable) bool¶
- Test whether - selfcontains all data IDs in- other.- Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other.dimensions == self.dimensions.
 
- other
- Returns:
 
 - issuperset(other: DataCoordinateIterable) bool¶
- Test whether - othercontains all data IDs in- self.- Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other.dimensions == self.dimensions.
 
- other
- Returns:
 
 - subset(dimensions: DimensionGroup | Iterable[str]) DataCoordinateSet¶
- Return a set whose data IDs identify a subset. - Parameters:
- dimensionsDimensionGrouporIterable[str]
- Dimensions to be identified by the data IDs in the returned iterable. Must be a subset of - self.dimensions.
 
- dimensions
- Returns:
- setDataCoordinateSet
- A - DataCoordinateSetwith- set.dimensions == dimensions. Will be- selfif- dimensions == self.dimensions. Elements are equivalent to those that would be created by calling- DataCoordinate.subseton all elements in- self, with deduplication and in arbitrary order.
 
- set
 
 - symmetric_difference(other: DataCoordinateIterable) DataCoordinateSet¶
- Return a new set with all data IDs in either parameters, not both. - Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other.dimensions == self.dimensions.
 
- other
- Returns:
- intersectionDataCoordinateSet
- A new - DataCoordinateSetinstance.
 
- intersection
 
 - toSet() DataCoordinateSet¶
- Transform this iterable into a - DataCoordinateSet.- Returns:
- setDataCoordinateSet
- A - DatasetCoordinateSetinstance with the same elements as- self, after removing any duplicates. May be- selfif it is already a- DataCoordinateSet.
 
- set
 
 - union(other: DataCoordinateIterable) DataCoordinateSet¶
- Return a new set that contains all data IDs in either parameters. - Parameters:
- otherDataCoordinateIterable
- An iterable of data IDs with - other.dimensions == self.dimensions.
 
- other
- Returns:
- intersectionDataCoordinateSet
- A new - DataCoordinateSetinstance.
 
- intersection