DataCoordinateSequence

class lsst.daf.butler.DataCoordinateSequence(dataIds: Sequence[lsst.daf.butler.core.dimensions._coordinate.DataCoordinate], graph: lsst.daf.butler.core.dimensions._graph.DimensionGraph, *, hasFull: Optional[bool, None] = None, hasRecords: Optional[bool, None] = None, check: bool = True)

Bases: lsst.daf.butler.core.dimensions._dataCoordinateIterable._DataCoordinateCollectionBase, collections.abc.Sequence, typing.Generic

Iterable supporting the full Sequence interface.

A DataCoordinateIterable implementation that supports the full collections.abc.Sequence interface.

Parameters:
dataIds : collections.abc.Sequence [ DataCoordinate ]

A sequence of DataCoordinate instances, with dimensions equal to graph.

graph : DimensionGraph

Dimensions identified by all data IDs in the set.

hasFull : bool, optional

If True, the caller guarantees that DataCoordinate.hasFull returns True for all given data IDs. If False, no such guarantee is made, and DataCoordinateSet.hasFull will always return False. If None (default), DataCoordinateSet.hasFull will be computed from the given data IDs, immediately if check is True, or on first use if check is False.

hasRecords : bool, optional

If True, the caller guarantees that DataCoordinate.hasRecords returns True for all given data IDs. If False, no such guarantee is made and DataCoordinateSet.hasRecords will always return False. If None (default), DataCoordinateSet.hasRecords will be computed from the given data IDs, immediately if check is True, or on first use if check is False.

check: `bool`, optional

If True (default) check that all data IDs are consistent with the given graph and state flags at construction. If False, no checking will occur.

Attributes Summary

graph Dimensions identified by these data IDs (DimensionGraph).
universe 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.
hasRecords() Return whether all data IDs in this iterable contain records.
index(value, [start, [stop]]) Raises ValueError if the value is not present.
subset(graph) Return a sequence whose data IDs identify a subset.
toSequence() Transform this iterable into a DataCoordinateSequence.
toSet() Transform this iterable into a DataCoordinateSet.

Attributes Documentation

graph

Dimensions identified by these data IDs (DimensionGraph).

universe

Universe that defines all known compatible dimensions.

(DimensionUniverse).

Methods Documentation

count(value) → integer -- return number of occurrences of value
static fromScalar(dataId: lsst.daf.butler.core.dimensions._coordinate.DataCoordinate) → lsst.daf.butler.core.dimensions._dataCoordinateIterable._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.

Returns:
iterable : DataCoordinateIterable

A DataCoordinateIterable instance of unspecified (i.e. implementation-detail) subclass. Guaranteed to implement the collections.abc.Sized (i.e. __len__) and collections.abc.Container (i.e. __contains__) interfaces as well as that of DataCoordinateIterable.

hasFull() → bool

Indicate if all data IDs in this iterable identify all dimensions.

Not just required dimensions.

Returns:
state : bool

If True, all(d.hasFull() for d in iterable) is guaranteed. If False, no guarantees are made.

hasRecords() → bool

Return whether all data IDs in this iterable contain records.

Returns:
state : bool

If True, all(d.hasRecords() for d in iterable) is guaranteed. If False, no guarantees are made.

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(graph: lsst.daf.butler.core.dimensions._graph.DimensionGraph) → lsst.daf.butler.core.dimensions._dataCoordinateIterable.DataCoordinateSequence

Return a sequence whose data IDs identify a subset.

Parameters:
graph : DimensionGraph

Dimensions to be identified by the data IDs in the returned iterable. Must be a subset of self.graph.

Returns:
set : DataCoordinateSequence

A DataCoordinateSequence with set.graph == graph. Will be self if graph == self.graph. Elements are equivalent to those that would be created by calling DataCoordinate.subset on all elements in self, in the same order and with no deduplication.

toSequence() → lsst.daf.butler.core.dimensions._dataCoordinateIterable.DataCoordinateSequence

Transform this iterable into a DataCoordinateSequence.

Returns:
seq : DataCoordinateSequence

A new DatasetCoordinateSequence with the same elements as self, in the same order. May be self if it is already a DataCoordinateSequence.

toSet() → lsst.daf.butler.core.dimensions._dataCoordinateIterable.DataCoordinateSet

Transform this iterable into a DataCoordinateSet.

Returns:
set : DataCoordinateSet

A DatasetCoordinateSet instance with the same elements as self, after removing any duplicates. May be self if it is already a DataCoordinateSet.