gemseo / utils

Hide inherited members

run_folder_manager module

Tools for unique run folder name generation.

class gemseo.utils.run_folder_manager.FoldersIter(value)

Bases: StrEnum

An enumeration.

NUMBERED = 'NUMBERED'
UUID = 'UUID'
class gemseo.utils.run_folder_manager.RunFolderManager(output_folder_basepath, folders_iter=FoldersIter.NUMBERED, use_shell=True)[source]

Bases: object

Class generating unique names for run folders.

Parameters:
  • folders_iter (FoldersIter) –

    The type of unique identifiers for the output folders. If NUMBERED, the generated output folders will be f"output_folder_basepath{i+1}", where i is the maximum value of the already existing f"output_folder_basepath{i}" folders. Otherwise, a unique number based on the UUID function is generated. This last option shall be used if multiple MDO processes are run in the same work folder.

    By default it is set to “NUMBERED”.

  • use_shell (bool) –

    If True, run the command using the default shell. Otherwise, run directly the command.

    By default it is set to True.

  • output_folder_basepath (str) – The base path of the execution folders.

get_unique_run_folder_path()[source]

Generate a unique folder path for the run folder.

Returns: A unique Path to be used as run folder.

Return type:

Path