This commit is contained in:
Alfredo Oliviero 2024-11-04 12:11:20 +01:00
parent be044a9768
commit 7f01181a86
1 changed files with 2 additions and 5 deletions

View File

@ -20,14 +20,11 @@ def cds_datadir(label=None, basepath=DEFAULT_BASEPTH, verbose=True):
# Create directory name with optional label
folder_name = f"out_{timestamp}_{sanitized_label}" if sanitized_label else f"out_{timestamp}"
datadir = os.path.join(basepath, folder_name)
datadir = os.path.join(basepath, folder_name) + os.sep
# Create the directory
os.makedirs(datadir, exist_ok=True)
if verbose:
print ("datadir: %s", datadir )
return datadir
# Example usage
directory = cds_datadir(label='example_label')
print(directory)