rail.core.configurable module
- class rail.core.configurable.Configurable
Bases:
objectBase class used to attach Ceci.StageParamters to a class
This implements:
being able to define parameters that are attached to a class
being able to create an object of that class from a dict with the required paramters
checking that all the required parameters are present and of the correct types
check that there are no additional parameters given
being able to write a snapshot of the current values of the paramters to yaml
Subclasses should:
add parameters to the config_options class member
set the yaml_tag class member to a unique value
- __init__(**kwargs)
C’tor
- Parameters:
**kwargs (Any) – Configuration parameters for this object, must match class.config_options data members
- Return type:
None
- property config: StageConfig
Return the underlying configuration
- classmethod full_class_name()
Return the full name of the class, including the parent module
- Return type:
str
- get(key, default_value=None)
Get a particular item by key, return default value if it is not present
- Parameters:
key (str)
default_value (Any | None)
- Return type:
Any
- static merge_named_lists(input_lists)
Merge lists, removing duplicate items
- Parameters:
input_lists (list[list[Configurable]]) – Lists to be merged
- Returns:
The merged list
- Return type:
list[Configurable]
- to_yaml_dict()
Create a yaml-convertable dict for this object
- Return type:
dict[str, dict[str, Any]]
- yaml_tag: str = ''