full_specs module
Gather in a single object all the parameters for LW to run.
- class ConfSpec(files='', beam='', beam_calculator='', beam_calculator_post='', plots='', evaluators='', design_space='', wtf='', **kwargs)[source]
Bases:
objectDefine structure of a configuration object.
- Parameters:
MANDATORY_CONFIG_ENTRIES – Entries that you must declare for this
ConfSpecto work.files (
str, default:'')beam (
str, default:'')beam_calculator (
str, default:'')beam_calculator_post (
str, default:'')plots (
str, default:'')evaluators (
str, default:'')design_space (
str, default:'')wtf (
str, default:'')
- __init__(files='', beam='', beam_calculator='', beam_calculator_post='', plots='', evaluators='', design_space='', wtf='', **kwargs)[source]
Declare the attributes.
- _get_proper_table(table_id, id_type='configured_object')[source]
Get the
TableConfSpecnamedtable_id.- Parameters:
- Return type:
- Returns:
The desired object.
- to_toml_strings(toml_fulldict, id_type='configured_object', original_toml_folder=None, **kwargs)[source]
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'], default:'configured_object') – Iftoml_fulldictkeys are name of the object (eg'beam') or of the table entry in theTOML(eg'my_proton_beam', without brackets).original_toml_folder (
Path|None, default:None) – Where the originalTOMLwas; this is used to resolve paths relative to this location.
- Return type:
- Returns:
The
TOMLcontent that can be directly written to aTOMLfile.
- prepare(toml_fulldict, toml_folder, id_type='configured_object', **kwargs)[source]
Check that all the tables in
toml_fulldictare valid.Also edit some values if necessary.
- Parameters:
toml_fulldict (
ConfigKw) – Holds the full configuration.id_type (
Literal['configured_object','table_entry'], default:'configured_object') – Iftoml_fulldictkeys are name of the object (eg'beam') or of the table entry in theTOML(eg'my_proton_beam'). Do not put the brackets present in theTOMLfile.toml_folder (
Path)
- Return type:
- Returns:
If the dict is valid or not.
- class SimplestConfSpec(*, beam='beam', files='files', beam_calculator='beam_calculator')[source]
Bases:
ConfSpecHold all the LightWin inputs, their types, allowed values, etc.
Defined for a run without optimization.
- Parameters: