DataCoordinateIterable¶
-
class
lsst.daf.butler.DataCoordinateIterable(*args, **kwds)¶ Bases:
Iterable[lsst.daf.butler.DataCoordinate]An abstract base class for homogeneous iterables of data IDs.
All elements of a
DataCoordinateIterableidentify the same set of dimensions (given by thegraphproperty) and generally have the sameDataCoordinate.hasFullandDataCoordinate.hasRecordsflag values.Attributes Summary
Dimensions identified by these data IDs (
DimensionGraph).Universe that defines all known compatible dimensions.
Methods Summary
constrain(query, columns)Constrain a SQL query to include or relate to only known data IDs.
fromScalar(dataId)Return a
DataCoordinateIterablecontaining 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(graph)Return a subset iterable.
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.
Methods Documentation
-
constrain(query:lsst.daf.butler.SimpleQuery, columns: Callable[[str], sqlalchemy.sql.elements.ColumnElement]) → None¶ Constrain a SQL query to include or relate to only known data IDs.
- Parameters
- query
SimpleQuery Struct that represents the SQL query to constrain, either by appending to its WHERE clause, joining a new table or subquery, or both.
- columns
Callable A callable that accepts
strdimension names and returns SQLAlchemy objects representing a column for that dimension’s primary key value in the query.
- query
-
static
fromScalar(dataId:lsst.daf.butler.DataCoordinate) → lsst.daf.butler.core.dimensions._dataCoordinateIterable._ScalarDataCoordinateIterable¶ Return a
DataCoordinateIterablecontaining the single data ID.- Parameters
- dataId
DataCoordinate Data ID to adapt. Must be a true
DataCoordinateinstance, not an arbitrary mapping. No runtime checking is performed.
- dataId
- Returns
- iterable
DataCoordinateIterable A
DataCoordinateIterableinstance 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(graph:lsst.daf.butler.DimensionGraph) →lsst.daf.butler.DataCoordinateIterable¶ Return a subset iterable.
This subset iterable returns data IDs that identify a subset of the dimensions that this one’s do.
- Parameters
- graph
DimensionGraph Dimensions to be identified by the data IDs in the returned iterable. Must be a subset of
self.graph.
- graph
- Returns
- iterable
DataCoordinateIterable A
DataCoordinateIterablewithiterable.graph == graph. May beselfifgraph == self.graph. Elements are equivalent to those that would be created by callingDataCoordinate.subseton all elements inself, possibly with deduplication and/or reordeding (depending on the subclass, which may make more specific guarantees).
- iterable
-
toSequence() →lsst.daf.butler.DataCoordinateSequence¶ Transform this iterable into a
DataCoordinateSequence.- Returns
- seq
DataCoordinateSequence A new
DatasetCoordinateSequencewith the same elements asself, in the same order. May beselfif it is already aDataCoordinateSequence.
- seq
-
toSet() →lsst.daf.butler.DataCoordinateSet¶ Transform this iterable into a
DataCoordinateSet.- Returns
- set
DataCoordinateSet A
DatasetCoordinateSetinstance with the same elements asself, after removing any duplicates. May beselfif it is already aDataCoordinateSet.
- set
-