LSST Applications  22.0.1,22.0.1+01bcf6a671,22.0.1+046ee49490,22.0.1+05c7de27da,22.0.1+0c6914dbf6,22.0.1+1220d50b50,22.0.1+12fd109e95,22.0.1+1a1dd69893,22.0.1+1c910dc348,22.0.1+1ef34551f5,22.0.1+30170c3d08,22.0.1+39153823fd,22.0.1+611137eacc,22.0.1+771eb1e3e8,22.0.1+94e66cc9ed,22.0.1+9a075d06e2,22.0.1+a5ff6e246e,22.0.1+a7db719c1a,22.0.1+ba0d97e778,22.0.1+bfe1ee9056,22.0.1+c4e1e0358a,22.0.1+cc34b8281e,22.0.1+d640e2c0fa,22.0.1+d72a2e677a,22.0.1+d9a6b571bd,22.0.1+e485e9761b,22.0.1+ebe8d3385e
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.base.connectionTypes.InitOutput Class Reference
Inheritance diagram for lsst.pipe.base.connectionTypes.InitOutput:
lsst.pipe.base.connectionTypes.BaseConnection

Public Member Functions

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

Static Public Attributes

 str
 
 bool
 

Detailed Description

Definition at line 269 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

◆ makeDatasetType()

def lsst.pipe.base.connectionTypes.BaseConnection.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 in lsst.pipe.base.connectionTypes.DimensionedConnection.

Definition at line 96 of file connectionTypes.py.

97  parentStorageClass: Optional[StorageClass] = None):
98  """Construct a true `DatasetType` instance with normalized dimensions.
99 
100  Parameters
101  ----------
102  universe : `lsst.daf.butler.DimensionUniverse`
103  Set of all known dimensions to be used to normalize the dimension
104  names specified in config.
105  parentStorageClass : `lsst.daf.butler.StorageClass`, optional
106  Parent storage class for component datasets; `None` otherwise.
107 
108  Returns
109  -------
110  datasetType : `DatasetType`
111  The `DatasetType` defined by this connection.
112  """
113  return DatasetType(self.name,
114  universe.empty,
115  self.storageClass,
116  parentStorageClass=parentStorageClass)
117 
118 
119 @dataclasses.dataclass(frozen=True)

Member Data Documentation

◆ bool

lsst.pipe.base.connectionTypes.BaseConnection.bool
staticinherited

Definition at line 61 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: