Skip to content

Commit 46dd773

Browse files
committed
ENH: tollerate trailing spaces
1 parent 4e16f10 commit 46dd773

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

heudiconv/heuristics/reproin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,9 @@ def parse_series_spec(series_spec):
787787

788788
# Parse the name according to our convention/specification
789789

790+
# leading or trailing spaces do not matter
791+
series_spec = series_spec.strip(' ')
792+
790793
# Strip off leading CAPITALS: prefix to accommodate some reported usecases:
791794
# https://github.com/ReproNim/reproin/issues/14
792795
# where PU: prefix is added by the scanner
@@ -988,8 +991,9 @@ def test_parse_series_spec():
988991
{'seqtype': 'func', 'seqtype_label': 'bold'}
989992

990993
# pdpn("bids_func_ses+_task-boo_run+") == \
991-
# order and PREFIX: should not matter
994+
# order and PREFIX: should not matter, as well as trailing spaces
992995
assert \
996+
pdpn(" PREFIX:bids_func_ses+_task-boo_run+ ") == \
993997
pdpn("PREFIX:bids_func_ses+_task-boo_run+") == \
994998
pdpn("bids_func_ses+_run+_task-boo") == \
995999
{

0 commit comments

Comments
 (0)