DataCoordinateSequence¶
- class lsst.daf.butler.DataCoordinateSequence(dataIds: Sequence[DataCoordinate], graph: DimensionGraph | None = None, *, dimensions: Iterable[str] | DimensionGroup | DimensionGraph | None = None, hasFull: bool | None = None, hasRecords: bool | None = None, check: bool = True, universe: DimensionUniverse | None = None)¶
Bases:
_DataCoordinateCollectionBase
,Sequence
[DataCoordinate
]Iterable supporting the full Sequence interface.
A
DataCoordinateIterable
implementation that supports the fullcollections.abc.Sequence
interface.- Parameters:
- dataIds
collections.abc.Sequence
[DataCoordinate
] A sequence of
DataCoordinate
instances, with dimensions equal tograph
.- graph
DimensionGraph
, optional Dimensions identified by all data IDs in the collection. Ignored if
dimensions
is provided, and deprecated with removal after v27.- dimensions
Iterable
[str
],DimensionGroup
,DimensionGraph
, optional Dimensions identified by all data IDs in the collection. Must be provided unless
graph
is.- hasFull
bool
, optional If
True
, the caller guarantees thatDataCoordinate.hasFull
returnsTrue
for all given data IDs. IfFalse
, no such guarantee is made, andDataCoordinateSet.hasFull
will always returnFalse
. IfNone
(default),DataCoordinateSet.hasFull
will be computed from the given data IDs, immediately ifcheck
isTrue
, or on first use ifcheck
isFalse
.- hasRecords
bool
, optional If
True
, the caller guarantees thatDataCoordinate.hasRecords
returnsTrue
for all given data IDs. IfFalse
, no such guarantee is made andDataCoordinateSet.hasRecords
will always returnFalse
. IfNone
(default),DataCoordinateSet.hasRecords
will be computed from the given data IDs, immediately ifcheck
isTrue
, or on first use ifcheck
isFalse
.- check
bool
, optional If
True
(default) check that all data IDs are consistent with the givengraph
and state flags at construction. IfFalse
, no checking will occur.- universe
DimensionUniverse
Object that manages all dimension definitions.
- dataIds
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
count
(value)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.
index
(value, [start, [stop]])Raises ValueError if the value is not present.
subset
(dimensions)Return a sequence whose data IDs identify a subset.
Transform this iterable into a
DataCoordinateSequence
.toSet
()Transform this iterable into a
DataCoordinateSet
.Attributes Documentation
- dimensions¶
- 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
- count(value) integer -- return number of occurrences of value ¶
- 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
- hasFull() bool ¶
Indicate if all data IDs in this iterable identify all dimensions.
Not just required dimensions.
- index(value[, start[, stop]]) integer -- return first index of value. ¶
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- subset(dimensions: DimensionGraph | DimensionGroup | Iterable[str]) DataCoordinateSequence ¶
Return a sequence whose data IDs identify a subset.
- 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:
- set
DataCoordinateSequence
A
DataCoordinateSequence
withset.graph == graph
. Will beself
ifgraph == self.graph
. Elements are equivalent to those that would be created by callingDataCoordinate.subset
on all elements inself
, in the same order and with no deduplication.
- set
- 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