Skip to content

Commit

Permalink
DEV: minor change; sort glob list
Browse files Browse the repository at this point in the history
  • Loading branch information
jungheejung committed Aug 7, 2024
1 parent 42ba5fd commit cfb2c98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spacetop_prep/events/bidsify_shortvideos.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def calc_adjusted_angle_df(df, x_col, y_col, xcenter, ycenter):

# get a list of subjects with available data
folders = glob.glob(os.path.join(outputDir, 'sub-*'))
subList = [os.path.basename(x) for x in folders]
taskname = 'task-shortvideo'
sublist = sorted([os.path.basename(x) for x in folders])
taskname = 'task-shortvideos'
session = 'ses-03'

run = '01'
Expand All @@ -51,7 +51,7 @@ def calc_adjusted_angle_df(df, x_col, y_col, xcenter, ycenter):
]


for sub in subList:
for sub in sublist:
dataFile = os.path.join(behDataDir, sub, taskname, f'{sub}_{session}_{taskname}_beh-preproc.csv')
if not os.path.isfile(dataFile):
print(f'No behavior data file for {sub}_run-{run}')
Expand Down Expand Up @@ -142,7 +142,7 @@ def calc_adjusted_angle_df(df, x_col, y_col, xcenter, ycenter):
newData = newData.replace(np.nan, 'n/a')

# save new events file
newFilename = os.path.join(outputDir, sub, session, 'func', f'{sub}_{session}_{taskname}_acq-mb8_run-01_events.tsv')
newFilename = os.path.join(outputDir, sub, session, 'func', f'{sub}_{session}_task-shortvideo_acq-mb8_run-01_events.tsv')
try:
newData.to_csv(newFilename, sep='\t', index=False)
except Exception as e:
Expand Down

0 comments on commit cfb2c98

Please sign in to comment.