Run From Path (Core)#

alts.core.run_from_path
load_module(dirpath, file_name) module[source]#
Description
Loads 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]#
Description
Loads 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]#
Description
Loads 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 in experiment_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]#
Description
Returns all blueprints from a module and sets their experiment path to exp_name.
It first tries to load a blueprint from module.blueprint. If that fails, it tries to load a list of blueprints from module.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]