LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.base.connectionTypes.Output Class Reference
Inheritance diagram for lsst.pipe.base.connectionTypes.Output:
lsst.pipe.base.connectionTypes.DimensionedConnection lsst.pipe.base.connectionTypes.BaseConnection

Public Member Functions

def __post_init__ (self)
 
def makeDatasetType (self, DimensionUniverse universe, Optional[StorageClass] parentStorageClass=None)
 
def __get__ (self, inst, klass)
 

Static Public Attributes

 bool
 
 str
 

Detailed Description

Definition at line 259 of file connectionTypes.py.

Member Function Documentation

◆ __get__()

def lsst.pipe.base.connectionTypes.BaseConnection.__get__ (   self,
  inst,
  klass 
)
inherited
Descriptor method

This is a method used to turn a connection into a descriptor.
When a connection is added to a connection class, it is a class level
variable. This method makes accessing this connection, on the
instance of the connection class owning this connection, return a
result specialized for that instance. In the case of connections
this specifically means names specified in a config instance will
be visible instead of the default names for the connection.

Definition at line 63 of file connectionTypes.py.

63  def __get__(self, inst, klass):
64  """Descriptor method
65 
66  This is a method used to turn a connection into a descriptor.
67  When a connection is added to a connection class, it is a class level
68  variable. This method makes accessing this connection, on the
69  instance of the connection class owning this connection, return a
70  result specialized for that instance. In the case of connections
71  this specifically means names specified in a config instance will
72  be visible instead of the default names for the connection.
73  """
74  # If inst is None, this is being accessed by the class and not an
75  # instance, return this connection itself
76  if inst is None:
77  return self
78  # If no object cache exists, create one to track the instances this
79  # connection has been accessed by
80  if not hasattr(inst, '_connectionCache'):
81  object.__setattr__(inst, '_connectionCache', {})
82  # Look up an existing cached instance
83  idSelf = id(self)
84  if idSelf in inst._connectionCache:
85  return inst._connectionCache[idSelf]
86  # Accumulate the parameters that define this connection
87  params = {}
88  for field in dataclasses.fields(self):
89  params[field.name] = getattr(self, field.name)
90  # Get the name override defined by the instance of the connection class
91  params['name'] = inst._nameOverrides[self.varName]
92  # Return a new instance of this connection specialized with the
93  # information provided by the connection class instance
94  return inst._connectionCache.setdefault(idSelf, self.__class__(**params))
95 
table::Key< int > id
Definition: Detector.cc:162

◆ __post_init__()

def lsst.pipe.base.connectionTypes.DimensionedConnection.__post_init__ (   self)
inherited

Definition at line 144 of file connectionTypes.py.

144  def __post_init__(self):
145  if isinstance(self.dimensions, str):
146  raise TypeError("Dimensions must be iterable of dimensions, got str,"
147  "possibly omitted trailing comma")
148  if not isinstance(self.dimensions, typing.Iterable):
149  raise TypeError("Dimensions must be iterable of dimensions")
150 

◆ makeDatasetType()

def lsst.pipe.base.connectionTypes.DimensionedConnection.makeDatasetType (   self,
DimensionUniverse  universe,
Optional[StorageClass]   parentStorageClass = None 
)
inherited
Construct a true `DatasetType` instance with normalized dimensions.

Parameters
----------
universe : `lsst.daf.butler.DimensionUniverse`
    Set of all known dimensions to be used to normalize the dimension
    names specified in config.
parentStorageClass : `lsst.daf.butler.StorageClass`, optional
    Parent storage class for component datasets; `None` otherwise.

Returns
-------
datasetType : `DatasetType`
    The `DatasetType` defined by this connection.

Reimplemented from lsst.pipe.base.connectionTypes.BaseConnection.

Definition at line 151 of file connectionTypes.py.

152  parentStorageClass: Optional[StorageClass] = None):
153  """Construct a true `DatasetType` instance with normalized dimensions.
154 
155  Parameters
156  ----------
157  universe : `lsst.daf.butler.DimensionUniverse`
158  Set of all known dimensions to be used to normalize the dimension
159  names specified in config.
160  parentStorageClass : `lsst.daf.butler.StorageClass`, optional
161  Parent storage class for component datasets; `None` otherwise.
162 
163  Returns
164  -------
165  datasetType : `DatasetType`
166  The `DatasetType` defined by this connection.
167  """
168  return DatasetType(self.name,
169  universe.extract(self.dimensions),
170  self.storageClass, isCalibration=self.isCalibration,
171  parentStorageClass=parentStorageClass)
172 
173 
174 @dataclasses.dataclass(frozen=True)

Member Data Documentation

◆ bool

lsst.pipe.base.connectionTypes.DimensionedConnection.bool
staticinherited

Definition at line 142 of file connectionTypes.py.

◆ str

lsst.pipe.base.connectionTypes.BaseConnection.str
staticinherited

Definition at line 60 of file connectionTypes.py.


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