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

Public Member Functions

 __init__ (self, config, field)
 
 types (self)
 
 __contains__ (self, k)
 
 __len__ (self)
 
 __iter__ (self)
 
 __getitem__ (self, k, at=None, label="default")
 
 __setitem__ (self, k, value, at=None, label="assignment")
 
 __setattr__ (self, attr, 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

 types
 

Protected Member Functions

 _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

 _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

 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
`~lsst.pex.config.ConfigChoiceField`.

Parameters
----------
config : `lsst.pex.config.Config`
    A configuration instance.
field : `lsst.pex.config.Field`-type
    A configuration field. Note that the `lsst.pex.config.Field.fieldmap`
    attribute must provide key-based access to configuration classes,
    (that is, ``typemap[name]``).

Constructor & Destructor Documentation

◆ __init__()

lsst.pex.config.configChoiceField.ConfigInstanceDict.__init__ ( self,
config,
field )

Reimplemented from lsst.pex.config.config.ConfigMeta.

Member Function Documentation

◆ __contains__()

lsst.pex.config.configChoiceField.ConfigInstanceDict.__contains__ ( self,
name )
Return `True` if the specified field exists in this config.

Parameters
----------
name : `str`
    Field name to test for.

Returns
-------
in : `bool`
    `True` if the specified field exists in the config.

Reimplemented from lsst.pex.config.config.Config.

◆ __iter__()

lsst.pex.config.configChoiceField.ConfigInstanceDict.__iter__ ( self)
Iterate over fields.

Reimplemented from lsst.pex.config.config.Config.

◆ __reduce__()

lsst.pex.config.configChoiceField.ConfigInstanceDict.__reduce__ ( self)
Reduction for pickling (function with arguments to reproduce).

We need to condense and reconstitute the `~lsst.pex.config.Config`,
since it may contain lambdas (as the ``check`` elements) that cannot
be pickled.

Reimplemented from lsst.pex.config.config.Config.

◆ __setattr__()

lsst.pex.config.configChoiceField.ConfigInstanceDict.__setattr__ ( self,
attr,
value,
at = None,
label = "assignment" )
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.config.Config.

Reimplemented in lsst.pex.config.registry.RegistryInstanceDict.

◆ _rename()

lsst.pex.config.configChoiceField.ConfigInstanceDict._rename ( self,
name )
protected
Rename this config object in its parent `~lsst.pex.config.Config`.

Parameters
----------
name : `str`
    New name for this config in its parent `~lsst.pex.config.Config`.

Notes
-----
This method uses the `~lsst.pex.config.Field.rename` method of
individual `lsst.pex.config.Field` instances.
`lsst.pex.config.Field` subclasses may need to implement a ``rename``
method for *this* method to work.

See Also
--------
lsst.pex.config.Field.rename

Reimplemented from lsst.pex.config.config.Config.

◆ freeze()

lsst.pex.config.configChoiceField.ConfigInstanceDict.freeze ( self)
Freeze the config.

Invoking this freeze method will create a local copy of the field
attribute's typemap. This decouples this instance dict from the
underlying objects type map ensuring that and subsequent changes to the
typemap will not be reflected in this instance (i.e imports adding
additional registry entries).

Reimplemented from lsst.pex.config.config.Config.

Reimplemented in lsst.pex.config.configChoiceField.ConfigChoiceField.


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