Skip to content

Commit 9056516

Browse files
committed
Console output per subset
1 parent 4540045 commit 9056516

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

erdetect/_erdetect.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def process(bids_subset_data_path, output_dir, preproc_prioritize_speed=False):
2828
# derive the bids subset root from the full path
2929
bids_subset_root = bids_subset_data_path[:bids_subset_data_path.rindex('_')]
3030

31+
# determine a subset specific output path
32+
output_root = os.path.join(output_dir, os.path.basename(os.path.normpath(bids_subset_root)))
33+
34+
# print subset information
35+
logging.info('------------------------ Processing subset ------------------------')
36+
log_indented_line('Subset input:', bids_subset_root + '.*')
37+
log_indented_line('Subset output path:', output_root + os.path.sep)
38+
logging.info('')
39+
3140

3241
#
3342
# Line noise removal and IEEG JSON sidecar
@@ -351,7 +360,6 @@ def process(bids_subset_data_path, output_dir, preproc_prioritize_speed=False):
351360
#
352361

353362
# make sure a subject directory exists
354-
output_root = os.path.join(output_dir, os.path.basename(os.path.normpath(bids_subset_root)))
355363
if not os.path.exists(output_root):
356364
try:
357365
os.makedirs(output_root)

erdetect/main_cli.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
Evoked response detection - command-line entry-point
44
=====================================================
5-
Command-line entry-point python script for the automatic detection of evoked responses in CCEP data.
5+
Command-line entry-point script for the automatic detection of evoked responses in CCEP data.
66
77
88
Copyright 2022, Max van den Boom (Multimodal Neuroimaging Lab, Mayo Clinic, Rochester MN)
@@ -350,17 +350,20 @@
350350
if subset_name == subset_other_name:
351351
subsets.remove(subset_other)
352352

353+
# TODO: mention all subsets before start processing
354+
355+
353356
# loop through the participant's subsets for analysis
354357
for subset in subsets:
355358

356-
# print subset information
357-
logging.info('------------------------')
358-
log_indented_line('Subset:', subset)
359+
# empty space
360+
logging.info('')
361+
logging.info('')
359362
logging.info('')
360363

361364
#
362365
try:
363-
process_subset(subset, args.output_dir, preproc_prioritize_speed)
366+
process(subset, args.output_dir, preproc_prioritize_speed)
364367
except RuntimeError:
365368
logging.error('Error while processing dataset, exiting...')
366369
exit(1)
@@ -369,5 +372,8 @@
369372
#
370373
logging.warning('Participant \'' + subject + '\' could not be found, skipping')
371374

372-
375+
# empty space and end message
376+
logging.info('')
377+
logging.info('')
378+
logging.info('')
373379
logging.info('- Finished running')

0 commit comments

Comments
 (0)