LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct Class Reference

Public Member Functions

def __init__ (self, Config config, ConfigurableActionStructField field, Mapping[str, ConfigurableAction] value, Any at, str label)
 
List[tuple] history (self)
 
Iterable[str] fieldNames (self)
 
None __setattr__ (self, str attr, Union[ConfigurableAction, Type[ConfigurableAction]] value, at=None, label='setattr', setHistory=False)
 
def __getattr__ (self, attr)
 
def __delattr__ (self, name)
 
Iterable[ConfigurableAction] __iter__ (self)
 
Iterable[Tuple[str, ConfigurableAction]] items (self)
 

Static Public Attributes

 update = ConfigurableActionStructUpdater()
 
 remove = ConfigurableActionStructRemover()
 

Detailed Description

A ConfigurableActionStruct is the storage backend class that supports
the ConfigurableActionStructField. This class should not be created
directly.

This class allows managing a collection of `ConfigurableActions` with a
struct like interface, that is to say in an attribute like notation.

Attributes can be dynamically added or removed as such:

ConfigurableActionStructInstance.variable1 = a_configurable_action
del ConfigurableActionStructInstance.variable1

Each action is then available to be individually configured as a normal
`lsst.pex.config.Config` object.

ConfigurableActionStruct supports two special convenance attributes.

The first is `update`. You may assign a dict of `ConfigurableActions` or
a `ConfigurableActionStruct` to this attribute which will update the
`ConfigurableActionStruct` on which the attribute is invoked such that it
will be updated to contain the entries specified by the structure on the
right hand side of the equals sign.

The second convenience attribute is named remove. You may assign an
iterable of strings which correspond to attribute names on the
`ConfigurableActionStruct`. All of the corresponding attributes will then
be removed. If any attribute does not exist, an `AttributeError` will be
raised. Any attributes in the Iterable prior to the name which raises will
have been removed from the `ConfigurableActionStruct`

Definition at line 88 of file _configurableActionStructField.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.__init__ (   self,
Config  config,
ConfigurableActionStructField  field,
Mapping[str, ConfigurableAction]  value,
Any  at,
str  label 
)

Definition at line 129 of file _configurableActionStructField.py.

130  value: Mapping[str, ConfigurableAction], at: Any, label: str):
131  object.__setattr__(self, '_config_', weakref.ref(config))
132  object.__setattr__(self, '_attrs', {})
133  object.__setattr__(self, '_field', field)
134  object.__setattr__(self, '_history', [])
135 
136  self.history.append(("Struct initialized", at, label))
137 
138  if value is not None:
139  for k, v in value.items():
140  setattr(self, k, v)
141 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

Member Function Documentation

◆ __delattr__()

def lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.__delattr__ (   self,
  name 
)

Definition at line 183 of file _configurableActionStructField.py.

183  def __delattr__(self, name):
184  if name in self._attrs:
185  del self._attrs[name]
186  else:
187  super().__delattr__(name)
188 

◆ __getattr__()

def lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.__getattr__ (   self,
  attr 
)

Definition at line 177 of file _configurableActionStructField.py.

177  def __getattr__(self, attr):
178  if attr in object.__getattribute__(self, '_attrs'):
179  return self._attrs[attr]
180  else:
181  super().__getattribute__(attr)
182 

◆ __iter__()

Iterable[ConfigurableAction] lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.__iter__ (   self)

Definition at line 189 of file _configurableActionStructField.py.

189  def __iter__(self) -> Iterable[ConfigurableAction]:
190  return iter(self._attrs.values())
191 

◆ __setattr__()

None lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.__setattr__ (   self,
str  attr,
Union[ConfigurableAction, Type[ConfigurableAction]]  value,
  at = None,
  label = 'setattr',
  setHistory = False 
)

Definition at line 157 of file _configurableActionStructField.py.

158  at=None, label='setattr', setHistory=False) -> None:
159 
160  if hasattr(self._config, '_frozen') and self._config._frozen:
161  msg = "Cannot modify a frozen Config. "\
162  f"Attempting to set item {attr} to value {value}"
163  raise FieldValidationError(self._field, self._config, msg)
164 
165  if attr not in (self.__dict__.keys() | type(self).__dict__.keys()):
166  name = _joinNamePath(self._config._name, self._field.name, attr)
167  if at is None:
168  at = getCallStack()
169  if isinstance(value, ConfigurableAction):
170  valueInst = type(value)(__name=name, __at=at, __label=label, **value._storage)
171  else:
172  valueInst = value(__name=name, __at=at, __label=label)
173  self._attrs[attr] = valueInst
174  else:
175  super().__setattr__(attr, value)
176 
table::Key< int > type
Definition: Detector.cc:163
def getCallStack(skip=0)
Definition: callStack.py:175

◆ fieldNames()

Iterable[str] lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.fieldNames (   self)

Definition at line 154 of file _configurableActionStructField.py.

154  def fieldNames(self) -> Iterable[str]:
155  return self._attrs.keys()
156 

◆ history()

List[tuple] lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.history (   self)

Definition at line 150 of file _configurableActionStructField.py.

150  def history(self) -> List[tuple]:
151  return self._history
152 

◆ items()

Iterable[Tuple[str, ConfigurableAction]] lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.items (   self)

Definition at line 192 of file _configurableActionStructField.py.

192  def items(self) -> Iterable[Tuple[str, ConfigurableAction]]:
193  return iter(self._attrs.items())
194 
195 
std::vector< SchemaItem< Flag > > * items

Member Data Documentation

◆ remove

lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.remove = ConfigurableActionStructRemover()
static

Definition at line 127 of file _configurableActionStructField.py.

◆ update

lsst.pipe.tasks.configurableActions._configurableActionStructField.ConfigurableActionStruct.update = ConfigurableActionStructUpdater()
static

Definition at line 126 of file _configurableActionStructField.py.


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