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 the dimensions property) and generally have the same DataCoordinate.hasFull and DataCoordinate.hasRecords flag values.

Attributes Summary

dimensions

Dimensions identified by these data IDs (DimensionGroup).

universe

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.

hasRecords()

Return whether all data IDs in this iterable contain records.

subset(dimensions)

Return a subset iterable.

toSequence()

Transform this iterable into a DataCoordinateSequence.

toSet()

Transform this iterable into a DataCoordinateSet.

Attributes Documentation

dimensions

Dimensions identified by these data IDs (DimensionGroup).

universe

Universe that defines all known compatible dimensions.

(DimensionUniverse).

Methods Documentation

static fromScalar(dataId: DataCoordinate) _ScalarDataCoordinateIterable

Return a DataCoordinateIterable containing the single data ID.

Parameters:
dataIdDataCoordinate

Data ID to adapt. Must be a true DataCoordinate instance, not an arbitrary mapping. No runtime checking is performed.

Returns:
iterableDataCoordinateIterable

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.

abstract hasFull() bool

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

Not just required dimensions.

Returns:
statebool

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

abstract hasRecords() bool

Return whether all data IDs in this iterable contain records.

Returns:
statebool

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

abstract subset(dimensions: 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:
dimensionsDimensionGroup or Iterable [ str ]

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

Returns:
iterableDataCoordinateIterable

A DataCoordinateIterable with iterable.dimensions == dimensions. May be self if dimensions == self.dimensions. Elements are equivalent to those that would be created by calling DataCoordinate.subset on all elements in self, possibly with deduplication and/or reordering (depending on the subclass, which may make more specific guarantees).

toSequence() DataCoordinateSequence

Transform this iterable into a DataCoordinateSequence.

Returns:
seqDataCoordinateSequence

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

toSet() DataCoordinateSet

Transform this iterable into a DataCoordinateSet.

Returns:
setDataCoordinateSet

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