returned project_path attribute because removal breaks CI
@@ -17,6 +17,7 @@ class BIDSLayout(Layout):
def __init__(self, path, config=None, validate=False, **kwargs):
self.validator = BIDSValidator()
self.validate = validate
+ self.project_path = os.path.abspath(path)
if config is None:
root = dirname(abspath(__file__))
config = pathjoin(root, 'config', 'bids.json')
@@ -29,7 +30,7 @@ class BIDSLayout(Layout):
if not self.validate:
return True
to_check = f.path
- to_check = to_check.split(os.path.abspath(self.root), maxsplit=1)[1]
+ to_check = to_check.split(self.project_path, maxsplit=1)[1]
sep = os.path.sep
if to_check[:len(sep)] != sep:
