files_specs module

Define parameters necessary to define files.

Note

We define custom TableConfSpec class in order to also set up the folder to store results and the logging tool.

class FilesTableConfSpec(configured_object: Literal['beam', 'beam_calculator', 'beam_calculator_post', 'design_space', 'evaluators', 'files', 'plots', 'wtf'], table_entry: str, specs: Collection[KeyValConfSpec] | dict[str, Collection[KeyValConfSpec]] | dict[bool, Collection[KeyValConfSpec]], is_mandatory: bool = True, can_have_untested_keys: bool = False, selectkey_n_default: tuple[str, str | bool] | None = None, monkey_patches: dict[str, dict[str, Callable]] | dict[bool, dict[str, Callable]] | None = None)

Bases: TableConfSpec

Override the default table to add logging and results folder set up.

_pre_treat(toml_subdict: dict[str, Any], **kwargs) None

Set up the logging as well as the results folder.

Note

The toml_folder required by _create_project_folders is in the kwargs.

_set_up_logging(project_path: Path, log_file: str = 'lightwin.log', logfile_log_level: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', console_log_level: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', **toml_subdict) None

Set up the logging.

_create_project_folders(toml_folder: Path, project_folder: str | Path = '', **toml_subdict) Path

Create a folder to store outputs and log messages.

_set_project_path(toml_folder: Path, project_folder: str | Path = '') tuple[Path, bool]

Create a default project folder name if not given.