lsst.pex.config gba4ed39666+e464e2e6f0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
lsst.pex.config.configurableField.ConfigurableInstance Class Reference
Inheritance diagram for lsst.pex.config.configurableField.ConfigurableInstance:
lsst.pex.config.configurableField.ConfigurableField

Public Member Functions

 __init__ (self, config, field, at=None, label="default")
 
 apply (self, *args, **kw)
 
 retarget (self, target, ConfigClass=None, at=None, label="retarget")
 
 __getattr__ (self, name)
 
 __setattr__ (self, name, value, at=None, label="assignment")
 
 __delattr__ (self, name, at=None, label="delete")
 
 __reduce__ (self)
 

Protected Member Functions

Config _config (self)
 

Protected Attributes

 _field
 
 _config
 
 _value
 

Properties

 target = property(lambda x: x._target)
 
 ConfigClass = property(lambda x: x._ConfigClass)
 
 value = property(lambda x: x._value)
 

Detailed Description

A retargetable configuration in a `ConfigurableField` that proxies
a `~lsst.pex.config.Config`.

Parameters
----------
config : `~lsst.pex.config.Config`
    Config to proxy.
field : `~lsst.pex.config.ConfigurableField`
    Field to use.
at : `list` of `~lsst.pex.config.callStack.StackFrame` or `None`, optional
    Stack frame for history recording. Will be calculated if `None`.
label : `str`, optional
    Label to use for history recording.

Notes
-----
``ConfigurableInstance`` implements ``__getattr__`` and ``__setattr__``
methods that forward to the `~lsst.pex.config.Config` it holds.
``ConfigurableInstance`` adds a `retarget` method.

The actual `~lsst.pex.config.Config` instance is accessed using the
``value`` property (e.g. to get its documentation).  The associated
configurable object (usually a `~lsst.pipe.base.Task`) is accessed
using the ``target`` property.

Member Function Documentation

◆ __delattr__()

lsst.pex.config.configurableField.ConfigurableInstance.__delattr__ ( self,
name,
at = None,
label = "delete" )
Pretend to be an isntance of  ConfigClass.
Attributes defiend by ConfigurableInstance will shadow those defined
in ConfigClass.

◆ __setattr__()

lsst.pex.config.configurableField.ConfigurableInstance.__setattr__ ( self,
name,
value,
at = None,
label = "assignment" )
Pretend to be an instance of ConfigClass.

Attributes defined by ConfigurableInstance will shadow those defined
in ConfigClass

◆ apply()

lsst.pex.config.configurableField.ConfigurableInstance.apply ( self,
* args,
** kw )
Call the configurable.

Parameters
----------
*args : `~typing.Any`
    Arguments to use when calling the configurable.
**kw : `~typing.Any`
    Keyword parameters to use when calling.

Notes
-----
In addition to the user-provided positional and keyword arguments,
the configurable is also provided a keyword argument ``config`` with
the value of `ConfigurableInstance.value`.

◆ retarget()

lsst.pex.config.configurableField.ConfigurableInstance.retarget ( self,
target,
ConfigClass = None,
at = None,
label = "retarget" )
Target a new configurable and ConfigClass.

Parameters
----------
target : `type`
    Item to retarget.
ConfigClass : `type` or `None`, optional
    New config class to use.
at : `list` of `~lsst.pex.config.callStack.StackFrame` or `None`,\
        optional
    Stack for history recording.
label : `str`, optional
    Label for history recording.

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