LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Properties | Private Member Functions | List of all members
lsst.pex.config.registry.RegistryInstanceDict Class Reference
Inheritance diagram for lsst.pex.config.registry.RegistryInstanceDict:

Public Member Functions

def __init__
 
def apply
 
def __setattr__
 

Public Attributes

 registry
 

Properties

 target = property(_getTarget)
 
 targets = property(_getTargets)
 

Private Member Functions

def _getTarget
 
def _getTargets
 

Detailed Description

Definition at line 129 of file registry.py.

Constructor & Destructor Documentation

def lsst.pex.config.registry.RegistryInstanceDict.__init__ (   self,
  config,
  field 
)

Definition at line 130 of file registry.py.

131  def __init__(self, config, field):
132  ConfigInstanceDict.__init__(self, config, field)
133  self.registry = field.registry

Member Function Documentation

def lsst.pex.config.registry.RegistryInstanceDict.__setattr__ (   self,
  attr,
  value 
)

Definition at line 167 of file registry.py.

168  def __setattr__(self, attr, value):
169  if attr =="registry":
170  object.__setattr__(self, attr, value)
171  else:
172  ConfigInstanceDict.__setattr__(self, attr, value)
def lsst.pex.config.registry.RegistryInstanceDict._getTarget (   self)
private

Definition at line 134 of file registry.py.

135  def _getTarget(self):
136  if self._field.multi:
137  raise FieldValidationError(self._field, self._config,
138  "Multi-selection field has no attribute 'target'")
return self._field.typemap.registry[self._selection]
def lsst.pex.config.registry.RegistryInstanceDict._getTargets (   self)
private

Definition at line 141 of file registry.py.

142  def _getTargets(self):
143  if not self._field.multi:
144  raise FieldValidationError(self._field, self._config,
145  "Single-selection field has no attribute 'targets'")
return [self._field.typemap.registry[c] for c in self._selection]
def lsst.pex.config.registry.RegistryInstanceDict.apply (   self,
  args,
  kw 
)
Call the active target(s) with the active config as a keyword arg

If this is a multi-selection field, return a list obtained by calling 
each active target with its corresponding active config.

Additional arguments will be passed on to the configurable target(s)

Definition at line 148 of file registry.py.

149  def apply(self, *args, **kw):
150  """Call the active target(s) with the active config as a keyword arg
151 
152  If this is a multi-selection field, return a list obtained by calling
153  each active target with its corresponding active config.
154 
155  Additional arguments will be passed on to the configurable target(s)
156  """
157  if self.active is None:
158  msg = "No selection has been made. Options: %s" % \
159  (" ".join(self._field.typemap.registry.keys()))
160  raise FieldValidationError(self._field, self._config, msg)
161  if self._field.multi:
162  retvals = []
163  for c in self._selection:
164  retvals.append(self._field.typemap.registry[c](*args, config=self[c], **kw))
165  return retvals
166  else:
return self._field.typemap.registry[self.name](*args, config=self[self.name], **kw)

Member Data Documentation

lsst.pex.config.registry.RegistryInstanceDict.registry

Definition at line 132 of file registry.py.

Property Documentation

lsst.pex.config.registry.RegistryInstanceDict.target = property(_getTarget)
static

Definition at line 139 of file registry.py.

lsst.pex.config.registry.RegistryInstanceDict.targets = property(_getTargets)
static

Definition at line 146 of file registry.py.


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