Skip to content

Commit b117c78

Browse files
committed
make sure absolute paths are passed to validator and don't validate derivs
1 parent 826591b commit b117c78

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

bids/layout/layout.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,14 @@ def _validate_file(self, f):
299299
if not self.validate:
300300
return True
301301

302-
# For derivatives, we need to cheat a bit and construct a fake
303-
# derivatives path--prepend 'derivatives' and the pipeline name
304-
to_check = os.path.relpath(f, self.root)
302+
# Derivatives are currently not validated.
305303
if 'derivatives' in self.domains:
306-
to_check = os.path.join(
307-
'derivatives', self.description['PipelineDescription']['Name'],
308-
to_check)
304+
return True
309305

310-
sep = os.path.sep
311-
if to_check[:len(sep)] != sep:
312-
to_check = sep + to_check
306+
# BIDS validator expects absolute paths, but really these are relative
307+
# to the BIDS project root.
308+
to_check = os.path.relpath(f, self.root)
309+
to_check = os.path.join(os.path.sep, to_check)
313310

314311
return self.validator.is_bids(to_check)
315312

0 commit comments

Comments
 (0)