ConfigIR#
- class lsst.pipe.base.pipelineIR.ConfigIR(python: str | None = None, dataId: dict | None = None, file: list[str] = <factory>, rest: dict = <factory>)#
Bases:
objectIntermediate representation of configurations read from a pipeline yaml file.
Attributes Summary
A dataId that is used to constrain these config overrides to only quanta with matching dataIds.
A list of paths which points to a file containing config overrides to be applied.
A string of python code that is used to modify a configuration.
This is a dictionary of key value pairs, where the keys are strings corresponding to qualified fields on a config to override, and the values are strings representing the values to apply.
Methods Summary
formatted(parameters)Return a new ConfigIR object that is formatted according to the specified parameters.
maybe_merge(other_config)Merge another instance of a
ConfigIRinto this instance if possible.Convert to a representation used in yaml serialization.
Attributes Documentation
- dataId: dict | None = 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.
- file: list[str] = <dataclasses._MISSING_TYPE object>#
A list of paths which points to a file containing config overrides to be applied. This value may be an empty list if there are no overrides to apply.
- python: str | None = 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.
- rest: dict = <dataclasses._MISSING_TYPE object>#
This is a dictionary of key value pairs, where the keys are strings corresponding to qualified fields on a config to override, and the values are strings representing the values to apply.
Methods Documentation
- formatted(parameters: ParametersIR) ConfigIR#
Return 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.
- parameters
- maybe_merge(other_config: ConfigIR) Generator[ConfigIR, None, None]#
Merge another instance of a
ConfigIRinto 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#
Yields#
- Generator
ConfigIR A generator containing either self, or self and other_config if the configs could be merged or not respectively.
- Generator
- to_primitives() dict[str, str | dict | list[str]]#
Convert to a representation used in yaml serialization.