DataCoordinateIterable¶
- class lsst.daf.butler.DataCoordinateIterable¶
Bases:
Iterable
[DataCoordinate
]An abstract base class for homogeneous iterables of data IDs.
All elements of a
DataCoordinateIterable
identify the same set of dimensions (given by thegraph
property) and generally have the sameDataCoordinate.hasFull
andDataCoordinate.hasRecords
flag values.Attributes Summary
Dimensions identified by these data IDs (
DimensionGroup
).Dimensions identified by these data IDs (
DimensionGraph
).Universe that defines all known compatible dimensions.
Methods Summary
fromScalar
(dataId)Return a
DataCoordinateIterable
containing the single data ID.hasFull
()Indicate if all data IDs in this iterable identify all dimensions.
Return whether all data IDs in this iterable contain records.
subset
(dimensions)Return a subset iterable.
Transform this iterable into a
DataCoordinateSequence
.toSet
()Transform this iterable into a
DataCoordinateSet
.Attributes Documentation
- dimensions¶
Dimensions identified by these data IDs (
DimensionGroup
).
- graph¶
Dimensions identified by these data IDs (
DimensionGraph
).Deprecated since version v27: Deprecated in favor of .dimensions; will be removed after v26.
- universe¶
Universe that defines all known compatible dimensions.
Methods Documentation
- static fromScalar(dataId: DataCoordinate) _ScalarDataCoordinateIterable ¶
Return a
DataCoordinateIterable
containing the single data ID.- Parameters:
- dataId
DataCoordinate
Data ID to adapt. Must be a true
DataCoordinate
instance, not an arbitrary mapping. No runtime checking is performed.
- dataId
- Returns:
- iterable
DataCoordinateIterable
A
DataCoordinateIterable
instance of unspecified (i.e. implementation-detail) subclass. Guaranteed to implement thecollections.abc.Sized
(i.e.__len__
) andcollections.abc.Container
(i.e.__contains__
) interfaces as well as that ofDataCoordinateIterable
.
- iterable
- abstract hasFull() bool ¶
Indicate if all data IDs in this iterable identify all dimensions.
Not just required dimensions.
- abstract subset(dimensions: DimensionGraph | DimensionGroup | Iterable[str]) DataCoordinateIterable ¶
Return a subset iterable.
This subset iterable returns data IDs that identify a subset of the dimensions that this one’s do.
- Parameters:
- dimensions
DimensionGraph
,DimensionGroup
, orIterable
[str
] Dimensions to be identified by the data IDs in the returned iterable. Must be a subset of
self.dimensions
.
- dimensions
- Returns:
- iterable
DataCoordinateIterable
A
DataCoordinateIterable
withiterable.dimensions == dimensions
. May beself
ifdimensions == self.dimensions
. Elements are equivalent to those that would be created by callingDataCoordinate.subset
on all elements inself
, possibly with deduplication and/or reordering (depending on the subclass, which may make more specific guarantees).
- iterable
- toSequence() DataCoordinateSequence ¶
Transform this iterable into a
DataCoordinateSequence
.- Returns:
- seq
DataCoordinateSequence
A new
DatasetCoordinateSequence
with the same elements asself
, in the same order. May beself
if it is already aDataCoordinateSequence
.
- seq
- toSet() DataCoordinateSet ¶
Transform this iterable into a
DataCoordinateSet
.- Returns:
- set
DataCoordinateSet
A
DatasetCoordinateSet
instance with the same elements asself
, after removing any duplicates. May beself
if it is already aDataCoordinateSet
.
- set