lsst.pex.config gba4ed39666+1ac82b564f
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
lsst.pex.config.registry.RegistryInstanceDict Class Reference
Inheritance diagram for lsst.pex.config.registry.RegistryInstanceDict:
lsst.pex.config.configChoiceField.ConfigInstanceDict lsst.pex.config.config.Config lsst.pex.config.config.ConfigMeta

Public Member Functions

 __init__ (self, config, field)
 
 apply (self, *args, **kwargs)
 
 apply_with (self, selection, *args, **kwargs)
 
 __setattr__ (self, attr, value)
 
- Public Member Functions inherited from lsst.pex.config.configChoiceField.ConfigInstanceDict
 types (self)
 
 __contains__ (self, k)
 
 __len__ (self)
 
 __iter__ (self)
 
 __getitem__ (self, k, at=None, label="default")
 
 __setitem__ (self, k, value, at=None, label="assignment")
 
 freeze (self)
 
 __reduce__ (self)
 
- Public Member Functions inherited from lsst.pex.config.config.Config
 keys (self)
 
 values (self)
 
 items (self)
 
 __new__ (cls, *args, **kw)
 
 setDefaults (self)
 
 update (self, **kw)
 
 load (self, filename, root="config")
 
 loadFromStream (self, stream, root="config", filename=None, extraLocals=None)
 
 loadFromString (self, code, root="config", filename=None, extraLocals=None)
 
 save (self, filename, root="config")
 
 saveToString (self, skipImports=False)
 
 saveToStream (self, outfile, root="config", skipImports=False)
 
 toDict (self)
 
 names (self)
 
 validate (self)
 
 formatHistory (self, name, **kwargs)
 
 __delattr__ (self, attr, at=None, label="deletion")
 
 __eq__ (self, other)
 
 __ne__ (self, other)
 
 __str__ (self)
 
 __repr__ (self)
 
 compare (self, other, shortcut=True, rtol=1e-8, atol=1e-8, output=None)
 
 __init_subclass__ (cls, **kwargs)
 

Public Attributes

 registry
 
- Public Attributes inherited from lsst.pex.config.configChoiceField.ConfigInstanceDict
 types
 

Protected Member Functions

 _getTarget (self)
 
 _getTargets (self)
 
- Protected Member Functions inherited from lsst.pex.config.configChoiceField.ConfigInstanceDict
 _setSelection (self, value, at=None, label="assignment")
 
 _getNames (self)
 
 _setNames (self, value)
 
 _delNames (self)
 
 _getName (self)
 
 _setName (self, value)
 
 _delName (self)
 
 _getActive (self)
 
 _rename (self, fullname)
 
- Protected Member Functions inherited from lsst.pex.config.config.Config
 _save (self, outfile)
 
 _collectImports (self)
 
 _fromPython (cls, config_py)
 

Protected Attributes

 _field
 
 _config
 
 _selection
 
- Protected Attributes inherited from lsst.pex.config.configChoiceField.ConfigInstanceDict
 _dict
 
 _selection
 
 _config
 
 _field
 
 _history
 
 _typemap
 
- Protected Attributes inherited from lsst.pex.config.config.Config
 _imports
 
 _frozen
 
 _name
 
- Protected Attributes inherited from lsst.pex.config.config.ConfigMeta
 _fields
 
 _source
 

Properties

 target = property(_getTarget)
 
 targets = property(_getTargets)
 
- Properties inherited from lsst.pex.config.configChoiceField.ConfigInstanceDict
 names = property(_getNames, _setNames, _delNames)
 
 name = property(_getName, _setName, _delName)
 
 active = property(_getActive)
 
- Properties inherited from lsst.pex.config.config.Config
 history = property(lambda x: x._history)
 

Additional Inherited Members

- Static Protected Attributes inherited from lsst.pex.config.config.Config
dict _storage [str, Any]
 
dict _fields [str, Field]
 
dict _history [str, list[Any]]
 
set _imports [Any]
 

Detailed Description

Dictionary of instantiated configs, used to populate a `RegistryField`.

Parameters
----------
config : `lsst.pex.config.Config`
    Configuration instance.
field : `RegistryField`
    Configuration field.

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ __setattr__()

lsst.pex.config.registry.RegistryInstanceDict.__setattr__ ( self,
attr,
value )
Set an attribute (such as a field's value).

Notes
-----
Unlike normal Python objects, `~lsst.pex.config.Config` objects are
locked such that no additional attributes nor properties may be added
to them dynamically.

Although this is not the standard Python behavior, it helps to protect
users from accidentally mispelling a field name, or trying to set a
non-existent field.

Reimplemented from lsst.pex.config.configChoiceField.ConfigInstanceDict.

◆ apply()

lsst.pex.config.registry.RegistryInstanceDict.apply ( self,
* args,
** kwargs )
Call the active target(s) with the active config as a keyword arg.

Parameters
----------
*args, **kwargs : `~typing.Any
    Additional arguments will be passed on to the configurable
    target(s).

Returns
-------
result
    If this is a single-selection field, the return value from calling
    the target. If this is a multi-selection field, a list thereof.

◆ apply_with()

lsst.pex.config.registry.RegistryInstanceDict.apply_with ( self,
selection,
* args,
** kwargs )
Call named target(s) with the corresponding config as a keyword
arg.

Parameters
----------
selection : `str` or `~collections.abc.Iterable` [ `str` ]
    Name or names of targets, depending on whether ``multi=True``.
*args, **kwargs
    Additional arguments will be passed on to the configurable
    target(s).

Returns
-------
result
    If this is a single-selection field, the return value from calling
    the target. If this is a multi-selection field, a list thereof.

Notes
-----
This method ignores the current selection in the ``name`` or ``names``
attribute, which is usually not what you want.  This method is most
useful in ``on_none`` callbacks provided at field construction, which
allow a context-dependent default to be used when no selection is
configured.

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