ConfigurableInstance

class lsst.pex.config.ConfigurableInstance(config, field, at=None, label='default')

Bases: Generic[FieldTypeVar]

A retargetable configuration in a ConfigurableField that proxies a Config.

Parameters:
configConfig

Config to proxy.

fieldConfigurableField

Field to use.

atlist of StackFrame or None, optional

Stack frame for history recording. Will be calculated if None.

labelstr, optional

Label to use for history recording.

Notes

ConfigurableInstance implements __getattr__ and __setattr__ methods that forward to the Config it holds. ConfigurableInstance adds a retarget method.

The actual Config instance is accessed using the value property (e.g. to get its documentation). The associated configurable object (usually a Task) is accessed using the target property.

Attributes Summary

ConfigClass

The configuration class (read-only)

target

The targeted configurable (read-only).

value

The ConfigClass instance (lsst.pex.config.Config-type, read-only).

Methods Summary

apply(*args, **kw)

Call the configurable.

retarget(target[, ConfigClass, at, label])

Target a new configurable and ConfigClass.

Attributes Documentation

ConfigClass

The configuration class (read-only)

target

The targeted configurable (read-only).

value

The ConfigClass instance (lsst.pex.config.Config-type, read-only).

Methods Documentation

apply(*args, **kw)

Call the configurable.

Parameters:
*argsAny

Arguments to use when calling the configurable.

**kwAny

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(target, ConfigClass=None, at=None, label='retarget')

Target a new configurable and ConfigClass.

Parameters:
targettype

Item to retarget.

ConfigClasstype or None, optional

New config class to use.

atlist of StackFrame or None, optional

Stack for history recording.

labelstr, optional

Label for history recording.