Skip to content

Commit 6984cdd

Browse files
authored
Merge pull request #342 from bids-standard/fix-validation-paths
Fix path validation.
2 parents f2a333c + 9f1722f commit 6984cdd

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
@@ -305,17 +305,14 @@ def _validate_file(self, f):
305305
if not self.validate:
306306
return True
307307

308-
# For derivatives, we need to cheat a bit and construct a fake
309-
# derivatives path--prepend 'derivatives' and the pipeline name
310-
to_check = os.path.relpath(f, self.root)
308+
# Derivatives are currently not validated.
311309
if 'derivatives' in self.domains:
312-
to_check = os.path.join(
313-
'derivatives', self.description['PipelineDescription']['Name'],
314-
to_check)
310+
return True
315311

316-
sep = os.path.sep
317-
if to_check[:len(sep)] != sep:
318-
to_check = sep + to_check
312+
# BIDS validator expects absolute paths, but really these are relative
313+
# to the BIDS project root.
314+
to_check = os.path.relpath(f, self.root)
315+
to_check = os.path.join(os.path.sep, to_check)
319316

320317
return self.validator.is_bids(to_check)
321318

0 commit comments

Comments
 (0)