full_specs module
Gather in a single object all the parameters for LW to run.
- class ConfSpec(files: str = '', beam: str = '', beam_calculator: str = '', beam_calculator_post: str = '', plots: str = '', evaluators: str = '', design_space: str = '', wtf: str = '', **kwargs)
Bases:
objectDefine structure of a configuration object.
- Parameters:
MANDATORY_CONFIG_ENTRIES (tuple[str, ...]) – Entries that you must declare for this
ConfSpecto work.
- __init__(files: str = '', beam: str = '', beam_calculator: str = '', beam_calculator_post: str = '', plots: str = '', evaluators: str = '', design_space: str = '', wtf: str = '', **kwargs) None
Declare the attributes.
- _get_proper_table(table_id: str, id_type: Literal['configured_object', 'table_entry'] = 'configured_object') TableConfSpec
Get the
TableConfSpecnamedtable_id.- Parameters:
table_id (str) – Name of the desired table.
id_type (Literal["configured_object", "table_entry"], optional) – If
table_idis the name of the object (eg'beam') or of the table entry in the.toml(eg'my_proton_beam', without brackets).
- Returns:
The desired object.
- Return type:
- to_toml_strings(toml_fulldict: dict[str, dict[str, Any]], id_type: Literal['configured_object', 'table_entry'] = 'configured_object', original_toml_folder: Path | None = None, **kwargs) list[str]
Convert the given dict in string that can be put in a
.toml.- Parameters:
toml_fulldict (dict[str, dict[str, Any]]) – Holds the full configuration.
id_type (Literal["configured_object", "table_entry"], optional) – If
toml_fulldictkeys are name of the object (eg'beam') or of the table entry in the.toml(eg'my_proton_beam', without brackets).original_toml_folder (pathlib.Path | None, optional) – Where the original
.tomlwas; this is used to resolve paths relative to this location.
- Returns:
The
.tomlcontent that can be directly written to a.tomlfile.- Return type:
- prepare(toml_fulldict: dict[str, dict[str, Any]], toml_folder: Path, id_type: Literal['configured_object', 'table_entry'] = 'configured_object', **kwargs) bool
Check that all the tables in
toml_fulldictare valid.Also edit some values if necessary.
- Parameters:
- Returns:
If the dict is valid or not.
- Return type: