Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lints in bidsreader.py #1178

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions python/lib/bidsreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
import lib.exitcode
import lib.utilities as utilities

try:
from bids import BIDSLayout
except ImportError:
try:
from bids.grabbids import BIDSLayout
except ImportError:
print("Could not find bids.layout or bids.grabbids")
exit(lib.exitcode.INVALID_IMPORT)
from bids import BIDSLayout

# import bids
# BIDSLayoutIndexer is required for PyBIDS >= 0.12.1
Expand Down Expand Up @@ -177,7 +170,7 @@ def candidates_list_validation(self, participants_info):
for row in participants_info:
# remove the "sub-" in front of the subject ID if present
row['participant_id'] = row['participant_id'].replace('sub-', '')
if not row['participant_id'] in subjects:
if row['participant_id'] not in subjects:
print(mismatch_message)
print(row['participant_id'] + 'is missing from the BIDS Layout')
print('List of subjects parsed by the BIDS layout: ' + ', '.join(subjects))
Expand Down
Loading