Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIDSPath no longer warns on missing file #1181

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 5 additions & 10 deletions examples/bidspath.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
BIDSPath is MNE-BIDS's working horse when it comes to file and folder
operations. Learn here how to use it.
"""
# Author: Richard Höchenberger <richard.hoechenberger@gmail.com>
# Authors: Richard Höchenberger <richard.hoechenberger@gmail.com>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD-3-Clause

Expand Down Expand Up @@ -141,15 +142,9 @@
print(bids_path.fpath)

# %%
# Oups! The cell above produced a ``RuntimeWarning`` that our data file could
# not be found. That's because we changed the ``run`` and ``session`` entities
# above, and the ``tiny_bids`` dataset does not contain corresponding data.
#
# That shows us that ``BIDSPath`` is doing a lot of guess-work and checking
# in the background, but note that this may change in the future.
#
# For now, let's revert to the last working iteration of our ``bids_path``
# instance.
# However, for the sake of the present examples, let's revert to the iteration
# of our ``bids_path`` instance with no ``run`` and ``session="eeg"``, as that
# file exists in the ``tiny_bids`` dataset.

bids_path.update(run=None, session="eeg")
print(bids_path.fpath)
Expand Down