Skip to content

Commit 2de4869

Browse files
authored
Merge pull request #17 from zkhan12/master
fix issues with lab_id type and directory creation errors
2 parents 46897a9 + 9d22e0d commit 2de4869

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,5 +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))
167+
os.makedirs(os.path.dirname(new_path), exist_ok=True)
168168
copyfile(old_path, new_path)

0 commit comments

Comments
 (0)