Documentation for layout is out of date
Chapter 2 of the documentation in the user's guide has some issues.
Section 2.1 Loading BIDS datasets
from bids.tests import get_test_data_path
should be:
from bids.tests.utils import get_test_data_path
Section 2.3 Extracting metadata
The following example crashes because there is no event file satisfying this: f = layout.get(task='nback', run=1, extension='nii.gz')[0].filename layout.get_events(f)
There is a top level event file associated with synthetic, but there doesn't seem to be an obvious way of getting at it with the layout object. I tried (it crashed): cols = layout.get_collections('dataset', types='events')
The next item doesn't pick up any metadata: f = layout.get(task='nback', run=1, extension='nii.gz')[0].filename layout.get_metadata(f)
I think that the user guide hasn't stayed up to date in the same way that the example notebook has. It might be worth it to switch to an auto-run Sphinx Gallery-type approach so that we at least see when the examples/guide become outdated.