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)[source]

Bases: object

Class generating unique names for run folders.

Parameters:
  • output_folder_basepath (str | Path) –

    The path the root folder of the run folders. If "" is passed then use the current working directory.

    By default it is set to “”.

  • 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”.

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