ConfigurableAction#

class lsst.pex.config.configurableActions.ConfigurableAction(*args, **kw)#

Bases: Config

A ConfigurableAction is an interface that extends a lsst.pex.config.Config class to include a __call__ method.

This interface is designed to create an action that can be used at runtime with a state that is determined during the configuration stage. A single action thus may be assigned multiple times, each with different configurations.

This allows state to be set and recorded at configuration time, making future reproduction of results easy.

This class is intended to be an interface only, but because of various inheritance conflicts this class can not be implemented as an Abstract Base Class. Instead, the __call__ method is purely virtual, meaning that it will raise a NotImplementedError when called. Subclasses that represent concrete actions must provide an override.

Attributes Summary

identity

If a configurable action is assigned to a ConfigurableActionField, or a ConfigurableActionStructField the name of the field will be bound to this variable when it is retrieved.

Methods Summary

__call__(*args, **kwargs)

Call self as a function.

copy()

Return a deep copy of this config.

Attributes Documentation

identity: str | None = None#

If a configurable action is assigned to a ConfigurableActionField, or a ConfigurableActionStructField the name of the field will be bound to this variable when it is retrieved.

Methods Documentation

__call__(*args: Any, **kwargs: Any) Any#

Call self as a function.

copy() ConfigurableAction#

Return a deep copy of this config.

Notes#

The returned config object is not frozen, even if the original was. If a nested config object is copied, it retains the name from its original hierarchy.

Nested objects are only shared between the new and old configs if they are not possible to modify via the config’s interfaces (e.g. entries in the the history list are not copied, but the lists themselves are, so modifications to one copy do not modify the other).