ConfigIR

class lsst.pipe.base.pipelineIR.ConfigIR(python: Optional[str] = None, dataId: Optional[dict] = None, file: List[str] = <factory>, rest: dict = <factory>)

Bases: object

Intermediate representation of configurations read from a pipeline yaml file.

Attributes Summary

dataId A dataId that is used to constrain these config overrides to only quanta with matching dataIds.
python A string of python code that is used to modify a configuration.

Methods Summary

formatted(parameters) Returns a new ConfigIR object that is formatted according to the specified parameters
maybe_merge(other_config) Merges another instance of a ConfigIR into this instance if possible.
to_primitives() Convert to a representation used in yaml serialization

Attributes Documentation

dataId = None

A dataId that is used to constrain these config overrides to only quanta with matching dataIds. This field can be None if there is no constraint. This is currently an unimplemented feature, and is placed here for future use.

python = None

A string of python code that is used to modify a configuration. This can also be None if there are no modifications to do.

Methods Documentation

formatted(parameters: lsst.pipe.base.pipelineIR.ParametersIR) → lsst.pipe.base.pipelineIR.ConfigIR

Returns a new ConfigIR object that is formatted according to the specified parameters

Parameters:
parameters : ParametersIR

Object that contains variable mappings used in substitution.

Returns:
config : ConfigIR

A new ConfigIR object formatted with the input parameters

maybe_merge(other_config: ConfigIR) → Generator[ConfigIR, None, None]

Merges another instance of a ConfigIR into this instance if possible. This function returns a generator that is either self if the configs were merged, or self, and other_config if that could not be merged.

Parameters:
other_config : ConfigIR

An instance of ConfigIR to merge into this instance.

Returns:
Generator : ConfigIR

A generator containing either self, or self and other_config if the configs could be merged or not respectively.

to_primitives() → dict

Convert to a representation used in yaml serialization