lsst.pipe.base  20.0.0-9-gabd0d4c+02e95b7327
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.graphBuilder._DatasetDict Class Reference
Inheritance diagram for lsst.pipe.base.graphBuilder._DatasetDict:

Public Member Functions

def __init__ (self, *args, DimensionGraph universe)
 
_DatasetDict fromDatasetTypes (cls, Iterable[DatasetType] datasetTypes, *DimensionUniverse universe)
 
_DatasetDict fromSubset (cls, Iterable[DatasetType] datasetTypes, _DatasetDict first, *_DatasetDict rest)
 
DimensionGraph dimensions (self)
 
NamedKeyDict[DatasetType, DatasetRef] unpackSingleRefs (self)
 
NamedKeyDict[DatasetType, DatasetRef] unpackMultiRefs (self)
 
Iterator[DatasetRef] extract (self, DatasetType datasetType, Iterable[DataCoordinate] dataIds)
 

Public Attributes

 universe
 

Detailed Description

A custom dictionary that maps `DatasetType` to a nested dictionary of
the known `DatasetRef` instances of that type.

Parameters
----------
args
    Positional arguments are forwarded to the `dict` constructor.
universe : `DimensionUniverse`
    Universe of all possible dimensions.

Definition at line 61 of file graphBuilder.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.graphBuilder._DatasetDict.__init__ (   self,
args,
DimensionGraph  universe 
)

Definition at line 72 of file graphBuilder.py.

Member Function Documentation

◆ dimensions()

DimensionGraph lsst.pipe.base.graphBuilder._DatasetDict.dimensions (   self)
The union of all dimensions used by all dataset types in this
dictionary, including implied dependencies (`DimensionGraph`).

Definition at line 122 of file graphBuilder.py.

◆ extract()

Iterator[DatasetRef] lsst.pipe.base.graphBuilder._DatasetDict.extract (   self,
DatasetType  datasetType,
Iterable[DataCoordinate]   dataIds 
)
Iterate over the contained `DatasetRef` instances that match the
given `DatasetType` and data IDs.

Parameters
----------
datasetType : `DatasetType`
    Dataset type to match.
dataIds : `Iterable` [ `DataCoordinate` ]
    Data IDs to match.

Returns
-------
refs : `Iterator` [ `DatasetRef` ]
    DatasetRef instances for which ``ref.datasetType == datasetType``
    and ``ref.dataId`` is in ``dataIds``.

Definition at line 161 of file graphBuilder.py.

◆ fromDatasetTypes()

_DatasetDict lsst.pipe.base.graphBuilder._DatasetDict.fromDatasetTypes (   cls,
Iterable[DatasetType]  datasetTypes,
*DimensionUniverse  universe 
)
Construct a dictionary from a flat iterable of `DatasetType` keys.

Parameters
----------
datasetTypes : `iterable` of `DatasetType`
    DatasetTypes to use as keys for the dict.  Values will be empty
    dictionaries.
universe : `DimensionUniverse`
    Universe of all possible dimensions.

Returns
-------
dictionary : `_DatasetDict`
    A new `_DatasetDict` instance.

Definition at line 77 of file graphBuilder.py.

◆ fromSubset()

_DatasetDict lsst.pipe.base.graphBuilder._DatasetDict.fromSubset (   cls,
Iterable[DatasetType]  datasetTypes,
_DatasetDict  first,
*_DatasetDict   rest 
)
Return a new dictionary by extracting items corresponding to the
given keys from one or more existing dictionaries.

Parameters
----------
datasetTypes : `iterable` of `DatasetType`
    DatasetTypes to use as keys for the dict.  Values will be obtained
    by lookups against ``first`` and ``rest``.
first : `_DatasetDict`
    Another dictionary from which to extract values.
rest
    Additional dictionaries from which to extract values.

Returns
-------
dictionary : `_DatasetDict`
    A new dictionary instance.

Definition at line 97 of file graphBuilder.py.

◆ unpackMultiRefs()

NamedKeyDict[DatasetType, DatasetRef] lsst.pipe.base.graphBuilder._DatasetDict.unpackMultiRefs (   self)
Unpack nested multi-element `DatasetRef` dicts into a new
mapping with `DatasetType` keys and `set` of `DatasetRef` values.

Returns
-------
dictionary : `NamedKeyDict`
    Dictionary mapping `DatasetType` to `DatasetRef`, with both
    `DatasetType` instances and string names usable as keys.

Definition at line 149 of file graphBuilder.py.

◆ unpackSingleRefs()

NamedKeyDict[DatasetType, DatasetRef] lsst.pipe.base.graphBuilder._DatasetDict.unpackSingleRefs (   self)
Unpack nested single-element `DatasetRef` dicts into a new
mapping with `DatasetType` keys and `DatasetRef` values.

This method assumes that each nest contains exactly one item, as is the
case for all "init" datasets.

Returns
-------
dictionary : `NamedKeyDict`
    Dictionary mapping `DatasetType` to `DatasetRef`, with both
    `DatasetType` instances and string names usable as keys.

Definition at line 131 of file graphBuilder.py.

Member Data Documentation

◆ universe

lsst.pipe.base.graphBuilder._DatasetDict.universe

Definition at line 74 of file graphBuilder.py.


The documentation for this class was generated from the following file: