-
Notifications
You must be signed in to change notification settings - Fork 130
Make pybids tutorial notebook great again #265
Copy link
Copy link
Closed
Description
ATM it is broken at layout.get(type='T1w', subject='01') puking with
~/proj/bids/pybids > cat pybids-tut.py
import bids.layout
import bids.tests
import os
layout = bids.layout.BIDSLayout(os.path.join(bids.tests.get_test_data_path(), '7t_trt'))
print(layout.get()[10])
print(layout.get(type='T1w', subject='01'))
~/proj/bids/pybids > python pybids-tut.py
File(filename='/home/yoh/proj/bids/pybids/bids/tests/data/7t_trt/sub-01/ses-1/fmap/sub-01_ses-1_run-2_phasediff.json', datatype='fmap', session='1', run=2, suffix='phasediff', subject='01')
Traceback (most recent call last):
File "pybids-tut.py", line 7, in <module>
print(layout.get(type='T1w', subject='01'))
File "/home/yoh/proj/bids/pybids/bids/layout/layout.py", line 288, in get
**md_kwargs)
File "/home/yoh/proj/bids/pybids/bids/layout/layout.py", line 524, in search
self.index_file(f)
File "/home/yoh/proj/bids/pybids/bids/layout/layout.py", line 465, in index_file
if f.path in self.file_index and not overwrite:
AttributeError: 'File' object has no attribute 'path'
blind attempt to fix in grabbit which somewhat brakes API (.filename of the namedtuple File becomes just the filename, not .path) is not sufficient alone, but I didn't want to dive deeper before decision on that one was made
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels