Skip to content

Commit 736ee8f

Browse files
Copilotshawntz
andcommitted
Fix code quality issues: remove unused variables and fix indentation
- Removed unused variable `projdir` (line 111) - Removed unused commented-out variable `qadir` (line 324) - Fixed inconsistent indentation to use 4-space multiples throughout lines 433-585 - All indentation now follows PEP 8 style guide Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
1 parent b843672 commit 736ee8f

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

08-fsl-glm/mk_level1_fsf_bbr.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def mk_level1_fsf_bbr(a):
108108
tasknum = 1
109109

110110
# Create the folders that are needed
111-
projdir=os.path.join(a.basedir,a.studyid)
112111
subid='sub-%s'%(a.subid)
113112
subid_ses=subid
114113
if a.sesname!="":
@@ -319,11 +318,6 @@ def mk_level1_fsf_bbr(a):
319318
else:
320319
print('no orthogonalization found')
321320

322-
# not tested yet
323-
# check for QA dir
324-
#qadir='%s/BOLD/task%03d_run%03d/QA'%(fmriprep_subdir,tasknum,a.runname)
325-
326-
327321
# Get task contrasts
328322
print('loading contrasts')
329323
# if it's a json file
@@ -492,9 +486,9 @@ def mk_level1_fsf_bbr(a):
492486
outfile.write('set fmri(custom%d) "%s"\n' % (ev+1,condfile))
493487
# if the EV file is missing
494488
else:
495-
outfile.write('set fmri(shape%d) 10\n' % (ev+1))
496-
print('%s is missing, using empty EV' % condfile)
497-
empty_evs.append(ev+1)
489+
outfile.write('set fmri(shape%d) 10\n' % (ev+1))
490+
print('%s is missing, using empty EV' % condfile)
491+
empty_evs.append(ev+1)
498492

499493
outfile.write('set fmri(convolve%d) 3\n' % (ev+1))
500494
outfile.write('set fmri(convolve_phase%d) 0\n' % (ev+1))
@@ -533,10 +527,10 @@ def mk_level1_fsf_bbr(a):
533527

534528
# to deal with missing EVs
535529
if len(empty_evs)>0:
536-
with open('%s/onsets/%s_task-%s_run-%s_empty_evs.txt' %
537-
(model_subdir, subid_ses, a.taskname, a.runname),'w') as empty_ev_file:
538-
for eev in empty_evs:
539-
empty_ev_file.write('%d\n'%eev)
530+
with open('%s/onsets/%s_task-%s_run-%s_empty_evs.txt' %
531+
(model_subdir, subid_ses, a.taskname, a.runname),'w') as empty_ev_file:
532+
for eev in empty_evs:
533+
empty_ev_file.write('%d\n'%eev)
540534

541535
# make one additional contrast across all conditions
542536
outfile.write('set fmri(conpic_real.%d) 1\n' % (ev+2))

0 commit comments

Comments
 (0)