lsst.pex.config gba4ed39666+e464e2e6f0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
lsst.pex.config.configurableActions._configurableActionStructField.ConfigurableActionStruct Class Reference
Inheritance diagram for lsst.pex.config.configurableActions._configurableActionStructField.ConfigurableActionStruct:

Public Member Functions

 __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, ActionTypeVar|type[ActionTypeVar] value, at=None, label="setattr", setHistory=False)
 
Any __getattr__ (self, attr)
 
 __delattr__ (self, name)
 
Iterator[ActionTypeVar] __iter__ (self)
 
Iterable[tuple[str, ActionTypeVar]] items (self)
 
bool __bool__ (self)
 

Static Public Attributes

 update = ConfigurableActionStructUpdater()
 
 remove = ConfigurableActionStructRemover()
 

Protected Member Functions

Config _config (self)
 

Protected Attributes

 _config
 
 _field
 
 _attrs
 

Static Protected Attributes

weakref _config_ .ref
 
dict _attrs [str, ActionTypeVar]
 
ConfigurableActionStructField _field
 
list _history [tuple]
 

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 `ConfigurableAction` with a
struct like interface, that is to say in an attribute like notation.

Parameters
----------
config : `~lsst.pex.config.Config`
    Config to use.
field : `ConfigurableActionStructField`
    Field to use.
value : `~collections.abc.Mapping` [`str`, `ConfigurableAction`]
    Value to assign.
at : `list` of `~lsst.pex.config.callStack.StackFrame` or `None`, optional
    Stack frames to use for history recording.
label : `str`, optional
    Label to use for history recording.

Notes
-----
Attributes can be dynamically added or removed as such:

.. code-block:: python

    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 convenience attributes.

The first is ``update``. You may assign a dict of `ConfigurableAction` 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`

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