Skip to content

Commit

Permalink
Merge pull request #326 from effigies/fix/misc
Browse files Browse the repository at this point in the history
FIX: Minor fixes
  • Loading branch information
effigies authored Dec 2, 2021
2 parents 3e3fa38 + 13e5071 commit 77d0348
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fitlins/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_parser():
help='regex pattern or string to ignore files')
g_bids.add_argument('--desc-label', action='store', default='preproc',
help="use BOLD files with the provided description label")
g_bids.add_argument('--database-path', action='store', default=None,
g_bids.add_argument('--database-path', action='store', default=None, type=op.abspath,
help="Path to directory containing SQLite database indices "
"for this BIDS dataset. "
"If a value is passed and the file already exists, "
Expand Down
7 changes: 4 additions & 3 deletions fitlins/utils/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def collect_participants(layout, participant_label=None, strict=False):
"""
all_participants = layout.get_subjects()
all_participants = sorted(layout.get_subjects())

# Error: bids_dir does not contain subjects
if not all_participants:
Expand All @@ -87,9 +87,10 @@ def collect_participants(layout, participant_label=None, strict=False):
return all_participants

# Drop sub- prefixes
participant_label = [sub[4:] if sub.startswith('sub-') else sub for sub in participant_label]
participant_label = [sub[4:] if sub.startswith('sub-') else sub
for sub in participant_label]

found_label = layout.get_subjects(subject=participant_label)
found_label = sorted(layout.get_subjects(subject=participant_label))

if not found_label:
raise BIDSError('Could not find participants [{}]'.format(
Expand Down
1 change: 1 addition & 0 deletions fitlins/viz/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ def write_full_report(report_dict, run_context, deriv_dir):
deriv_dir, fl_layout.build_path(
{'model': model}, PATH_PATTERNS, validate=False))
html = tpl.render(deroot({**report_dict, **run_context}, op.dirname(target_file)))
Path(target_file).parent.mkdir(parents=True, exist_ok=True)
Path(target_file).write_text(html)

0 comments on commit 77d0348

Please sign in to comment.