datadir
This commit is contained in:
parent
be044a9768
commit
7f01181a86
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue