From 3ff457295bd3d0d707b07c7e8f88506b1f949398 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Thu, 12 Mar 2020 19:17:16 -0400 Subject: [PATCH] [FIX] Remove colons from log filename (#542) * Remove colons from log-file name. * Update integration test regex for finding log files. --- tedana/tests/test_integration.py | 4 ++-- tedana/workflows/tedana.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tedana/tests/test_integration.py b/tedana/tests/test_integration.py index e8bb0c422..89cb3b105 100644 --- a/tedana/tests/test_integration.py +++ b/tedana/tests/test_integration.py @@ -37,8 +37,8 @@ def check_integration_outputs(fname, outpath): # Checks for log file log_regex = ('^tedana_' - '[12][0-9]{3}-[0-9]{2}-[0-9]{2}T[0-9]{2}:' - '[0-9]{2}:[0-9]{2}.tsv$') + '[12][0-9]{3}-[0-9]{2}-[0-9]{2}T[0-9]{2}' + '[0-9]{2}[0-9]{2}.tsv$') logfiles = [out for out in existing if re.match(log_regex, out)] assert len(logfiles) == 1 diff --git a/tedana/workflows/tedana.py b/tedana/workflows/tedana.py index 4696f0a98..1fb809762 100644 --- a/tedana/workflows/tedana.py +++ b/tedana/workflows/tedana.py @@ -330,8 +330,8 @@ def tedana_workflow(data, tes, out_dir='.', mask=None, # create logfile name basename = 'tedana_' extension = 'tsv' - isotime = datetime.datetime.now().replace(microsecond=0).isoformat() - logname = op.join(out_dir, (basename + isotime + '.' + extension)) + start_time = datetime.datetime.now().strftime('%Y-%m-%dT%H%M%S') + logname = op.join(out_dir, (basename + start_time + '.' + extension)) # set logging format log_formatter = logging.Formatter(