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
|
# Create directory name with optional label
|
||||||
folder_name = f"out_{timestamp}_{sanitized_label}" if sanitized_label else f"out_{timestamp}"
|
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
|
# Create the directory
|
||||||
os.makedirs(datadir, exist_ok=True)
|
os.makedirs(datadir, exist_ok=True)
|
||||||
if verbose:
|
if verbose:
|
||||||
print ("datadir: %s", datadir )
|
print ("datadir: %s", datadir )
|
||||||
return datadir
|
return datadir
|
||||||
|
|
||||||
# Example usage
|
|
||||||
directory = cds_datadir(label='example_label')
|
|
||||||
print(directory)
|
|
||||||
|
|
Loading…
Reference in New Issue