@@ -136,16 +136,16 @@ def parse(cls, path: str) -> dict[str, str]:
136136 --------
137137 >>> from bids_validator import BIDSValidator
138138 >>> validator = BIDSValidator()
139- >>> validator.parse(" /sub-01/anat/sub-01_rec-CSD_T1w.nii.gz" )
139+ >>> validator.parse(' /sub-01/anat/sub-01_rec-CSD_T1w.nii.gz' )
140140 {'subject': '01', 'datatype': 'anat', 'reconstruction': 'CSD', 'suffix': 'T1w',
141141 'extension': '.nii.gz'}
142- >>> validator.parse(" /sub-01/anat/sub-01_acq-23_rec-CSD_T1w.exe" )
142+ >>> validator.parse(' /sub-01/anat/sub-01_acq-23_rec-CSD_T1w.exe' )
143143 {}
144- >>> validator.parse(" home/username/my_dataset/participants.tsv" )
144+ >>> validator.parse(' home/username/my_dataset/participants.tsv' )
145145 Traceback (most recent call last):
146146 ...
147147 ValueError: Path must be relative to root of a BIDS dataset, ...
148- >>> validator.parse(" /participants.tsv" )
148+ >>> validator.parse(' /participants.tsv' )
149149 {'stem': 'participants', 'extension': '.tsv'}
150150
151151 """
@@ -196,10 +196,10 @@ def is_bids(cls, path: str) -> bool:
196196 >>> from bids_validator import BIDSValidator
197197 >>> validator = BIDSValidator()
198198 >>> filepaths = [
199- ... " /sub-01/anat/sub-01_rec-CSD_T1w.nii.gz" ,
200- ... " /sub-01/anat/sub-01_acq-23_rec-CSD_T1w.exe", # wrong extension
201- ... " home/username/my_dataset/participants.tsv", # not relative to root
202- ... " /participants.tsv" ,
199+ ... ' /sub-01/anat/sub-01_rec-CSD_T1w.nii.gz' ,
200+ ... ' /sub-01/anat/sub-01_acq-23_rec-CSD_T1w.exe', # wrong extension
201+ ... ' home/username/my_dataset/participants.tsv', # not relative to root
202+ ... ' /participants.tsv' ,
203203 ... ]
204204 >>> for filepath in filepaths:
205205 ... print(validator.is_bids(filepath))
0 commit comments