Skip to content

Commit ee92257

Browse files
committed
Merge branch 'master' of https://github.com/HBClab/accelBIDSTransform into fix_singularity
2 parents 3b89d0b + 2de4869 commit ee92257

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

accel_code/excel_lookup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def excel_lookup(lab_id, date, excel_file):
1414
df.LabID = df.LabID.astype(str)
1515

1616
try:
17-
ses = df[(df['LabID'].str.contains(lab_id)) &
17+
ses = df[(df['LabID'].str.contains(str(lab_id))) &
1818
(df['File date'] == date)]
1919

2020
# Check to make sure no labid/date combo gives more than one result

accel_code/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def main():
4242
lab_id = utils.get_lab_id(opts.old_file_path)
4343
date = utils.get_date(opts.old_file_path)
4444

45-
ses_id, project = excel_lookup.excel_lookup(lab_id, date, opts.excel_file)
45+
ses_id, project = excel_lookup.excel_lookup(lab_id, date, opts.excel_file_path)
4646

4747
sub_id = redcap_query.redcap_query(lab_id, project, opts.api_key)
4848

accel_code/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_date(old_file_path):
103103
# This function extracts the lab id from the old accelerometer file name
104104
def get_lab_id(old_file_path):
105105
old_file_name = os.path.basename(old_file_path)
106-
return(old_file_name.split(' ')[0])
106+
return(int(old_file_name.split(' ')[0]))
107107

108108

109109
# This function returns the root data path for storing project data
@@ -164,4 +164,5 @@ def make_directory(old_path, new_path, replace):
164164
os.remove(new_path)
165165
copyfile(old_path, new_path)
166166
else:
167+
os.makedirs(os.path.dirname(new_path), exist_ok=True)
167168
copyfile(old_path, new_path)

0 commit comments

Comments
 (0)