Run From Path (Core)#
- load_module(dirpath, file_name) module [source]#
- DescriptionLoads and returns the contents of the specified file as a module using the importlib library.
- Parameters:
dirpath (Dir path) – Path to folder containing module
file_name – The module in the folder to be loaded
file_name – File name
- Returns:
Loaded, interactable module from the file
- Return type:
ModuleType
- Raises:
ImportError – If importlib fails to find a module spec or fails to create spec.loader
- load_modules_from_folder(experiment_path) modules [source]#
- DescriptionLoads and returns all modules from the
experiment_path
folder.It does so by loading all .py files in the folder. Subfolders are ignored.- Parameters:
experiment_path (Dir path) – Path to folder with modules
- Returns:
The modules inside the
experiment_path
folder- Return type:
List[ModuleType]
- run_experiments_from_folder(experiment_path, parallel) None [source]#
- DescriptionLoads all blueprint found in modules in
experiment_path
and runs an experiment with each configuration.The output folder (“eval”) with its output files will be created inexperiment_path
.- Parameters:
experiment_path (Dir path) – Folder with modules containing blueprints
parallel (bool) – If True, runs experiments in parallel (default= False)
- set_exp_path_and_name(module, exp_path) blueprints [source]#
- DescriptionReturns all blueprints from a module and sets their experiment path to
exp_name
.It first tries to load a blueprint frommodule.blueprint
. If that fails, it tries to load a list of blueprints frommodule.blueprints
. If that fails, too, it returns an empty list.- Parameters:
module (ModuleType) – Module to be laoded from
exp_path (Dir path) – The desired experiment output path. A new output folder “eval” will be created in there.
- Returns:
All prepared blueprints
- Return type:
list[Blueprint]