get_bps_config_value¶
- lsst.ctrl.bps.parsl.get_bps_config_value(config: BpsConfig, key: str, dataType: type[T], default: T) T¶
- lsst.ctrl.bps.parsl.get_bps_config_value(config: BpsConfig, key: str, dataType: type[T], default: T | None = None, *, required: Literal[True]) T
- lsst.ctrl.bps.parsl.get_bps_config_value(config: BpsConfig, key: str, dataType: type[T], default: T | None = None) T | None
Get a value from the BPS configuration.
I find this more useful than
BpsConfig.__getitem__orBpsConfig.get.- Parameters:
- config
BpsConfig Configuration from which to retrieve value.
- key
str Key name.
- dataType
type We require that the returned value have this type.
- defaultoptional
Default value to be provided if
keydoesn’t exist in theconfig. A default value ofNonemeans that there is no default.- required
bool, optional If
True, the returned value may come from the configuration or from the default, but it may not beNone.
- config
- Returns:
- value
Value for
keyin theconfig`if it exists, otherwisedefault, if provided.
- Raises:
- KeyError
If
keyis not inconfigand no default is provided but a value isrequired.- RuntimeError
If the value is not set or is of the wrong type.