lsst.pex.config

The lsst.pex.config module provides a configuration system for the LSST Science Pipelines. The lsst.pex.config.Config class is an integral part of the task framework (see lsst.pipe.base), though lsst.pex.config is also useful on its own. Configuration parameters can be validated, documented, and even record the history of their values for provenance.

Changes

Using lsst.pex.config

Contributing

lsst.pex.config is developed at https://github.com/lsst/pex_config. You can find Jira issues for this module under the pex_config component.

Python API reference

lsst.pex.config Package

Functions

compareConfigs(name, c1, c2[, shortcut, ...])

Compare two lsst.pex.config.Config instances for equality.

compareScalars(name, v1, v2, output[, rtol, ...])

Compare two scalar values for equality.

getComparisonName(name1, name2)

Create a comparison name that is used for printed output of comparisons.

makeConfigClass(ctrl[, name, base, doc, ...])

Create a Config class that matches a C++ control object class.

makePropertySet(config)

Convert a configuration into a lsst.daf.base.PropertySet.

makeRegistry(doc[, configBaseType])

Create a Registry.

registerConfig(name, registry, target)

Add a class as a ConfigClass in a Registry and associate it with the given configurable.

registerConfigurable(name, registry[, ...])

Add a class as a configurable in a Registry instance.

wrap(ctrl)

Add fields from a C++ control class to a lsst.pex.config.Config class.

Classes

ChoiceField(doc[, dtype, allowed, default, ...])

A configuration field (Field subclass) that allows a user to select from a predefined set of values.

Config(*args, **kw)

Base class for configuration (config) objects.

ConfigChoiceField(doc, typemap[, default, ...])

A configuration field (Field subclass) that allows a user to choose from a set of Config types.

ConfigDictField(doc, keytype, itemtype[, ...])

A configuration field (Field subclass) that is a mapping of keys to Config instances.

ConfigField(doc[, dtype, default, check, ...])

A configuration field (Field subclass) that takes a Config-type as a value.

ConfigMeta(name, bases, dict_)

A metaclass for lsst.pex.config.Config.

ConfigurableField(doc, target[, ...])

A configuration field (Field subclass) that can be can be retargeted towards a different configurable (often a lsst.pipe.base.Task subclass).

ConfigurableInstance(config, field[, at, label])

A retargetable configuration in a ConfigurableField that proxies a Config.

DictField(doc[, keytype, itemtype, default, ...])

A configuration field (Field subclass) that maps keys and values.

Field(doc[, dtype, default, check, ...])

A field in a Config that supports int, float, complex, bool, and str data types.

FieldValidationError(field, config, msg)

Raised when a ~lsst.pex.config.Field is not valid in a particular ~lsst.pex.config.Config.

ListField(doc[, dtype, default, optional, ...])

A configuration field (Field subclass) that contains a list of values of a specific type.

RangeField(doc, dtype[, default, optional, ...])

A configuration field (lsst.pex.config.Field subclass) that requires the value to be in a specific numeric range.

Registry([configBaseType])

A base class for global registries, which map names to configurables.

RegistryField(doc, registry[, default, ...])

A configuration field whose options are defined in a Registry.

UnexpectedProxyUsageError

Exception raised when a proxy class is used in a context that suggests it should have already been converted to the thing it proxies.

lsst.pex.config.callStack Module

Functions

getCallerFrame([relative])

Get the frame for the user's caller.

getStackFrame([relative])

Get the StackFrame for the user's caller.

getCallStack([skip])

Retrieve the call stack for the caller.

Classes

StackFrame(filename, lineno, function[, content])

A single element of the stack trace.

lsst.pex.config.history Module

Functions

format(config[, name, writeSourceLine, ...])

Format the history record for a configuration, or a specific configuration field.

Classes

Color(text, category)

A controller that determines whether strings should be colored.

lsst.pex.config.configurableActions Package

Classes

ConfigurableAction(*args, **kw)

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

ConfigurableActionField(doc[, dtype, ...])

ConfigurableActionField is a subclass of Field that allows a single ConfigurableAction (or a subclass) to be assigned to it.

ConfigurableActionStruct(config, field, ...)

A ConfigurableActionStruct is the storage backend class that supports the ConfigurableActionStructField.

ConfigurableActionStructField(doc[, ...])

ConfigurableActionStructField is a Field subclass that allows a ConfigurableAction to be organized in a Config class in a manner similar to how a Struct works.