lsst.pex.config g733a212e47+2a59df914c
Loading...
Searching...
No Matches
Public Member Functions | Public 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

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

Public Attributes

 registry
 

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)
 

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__()

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

Member Function Documentation

◆ __setattr__()

def 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()

def lsst.pex.config.registry.RegistryInstanceDict.apply (   self,
args,
**  kwargs 
)
Call the active target(s) with the active 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.

◆ apply_with()

def 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: