Skip to content

Commit

Permalink
Removing sub- from participants ids in the get_group function
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Nov 22, 2023
1 parent e32e237 commit 336f273
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions narps_open/data/participants.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get_participants_subset(nb_participants: int = 108) -> list:
return get_all_participants()[0:nb_participants]

def get_group(group_name: str) -> list:
""" Return a list containing all the participants inside the group_name group
""" Return a list containing all the participants inside the group_name group """

Warning : the subject ids are return as written in the participants file (i.e.: 'sub-*')
"""
participants = get_participants_information()
return participants.loc[participants['group'] == group_name]['participant_id'].values.tolist()
group = participants.loc[participants['group'] == group_name]['participant_id'].values.tolist()

return [p.replace('sub-', '') for p in group]
4 changes: 2 additions & 2 deletions tests/data/test_participants.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ def test_get_group(mock_participants_data):
""" Test the get_group function """

assert part.get_group('') == []
assert part.get_group('equalRange') == ['sub-002', 'sub-004']
assert part.get_group('equalIndifference') == ['sub-001', 'sub-003']
assert part.get_group('equalRange') == ['002', '004']
assert part.get_group('equalIndifference') == ['001', '003']

0 comments on commit 336f273

Please sign in to comment.