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

[ENH] Add function to enable smart path search #1098 #1103

Merged
merged 22 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
.. _Denis Engemann: https://github.com/dengemann
.. _Bruno Hebling Vieira: https://bhvieira.github.io/
.. _Daniel McCloy: http://dan.mccloy.info
.. _Moritz Gerster: http://moritz-gerster.com
1 change: 1 addition & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Detailed list of changes
- Add :meth:`mne_bids.BIDSPath.find_matching_sidecar` to find the sidecar file associated with a given file path by `Eric Larson`_ (:gh:`1093`)
- When writing data via :func:`~mne_bids.write_raw_bids`, it is now possible to specify a custom mapping of :class:`mne.Annotations` descriptions to event codes via the ``event_id`` parameter. Previously, passing this parameter would always require to also pass ``events``, and using a custom event code mapping for annotations was impossible, by `Richard Höchenberger`_ (:gh:`1084`)
- Improve error message when :obj:`~mne_bids.BIDSPath.fpath` cannot be uniquely resolved by `Eric Larson`_ (:gh:`1097`)
- Add :func:`mne_bids.find_matching_paths` to get all bids paths that match the requirements by :newcontrib:`Moritz Gerster` (:gh:`1103`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct @hoechenberger? In the mne_bids contribution guide it is not described how to add lines so I followed the mne contributing guide.

Here I didn't add my name because I guess this works automatically?

The following authors contributed for the first time. Thank you so much! 🤩

* ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this works automatically

unfortunately not :-)

I followed the mne contributing guide.

it's a bit different here. You just add your name to the list you quoted above, and we don't have the sphinx role ":new_contrib:", so you can just follow the style of previous changelog entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I checked the old versions of whats_new.rst and understood that you don't have :newcontrib: as in mne.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want the function to be available as mne_bids.find_matching_paths, for example, you'd need to make additions here:

from mne_bids import commands
from mne_bids.report import make_report
from mne_bids.path import (BIDSPath, get_datatypes, get_entity_vals,
print_dir_tree, get_entities_from_fname,
search_folder_for_text, get_bids_path_from_fname)
from mne_bids.read import get_head_mri_trans, read_raw_bids
from mne_bids.utils import get_anonymization_daysback
from mne_bids.write import (make_dataset_description, write_anat,
write_raw_bids, mark_channels,
write_meg_calibration, write_meg_crosstalk,
get_anat_landmarks, anonymize_dataset)
from mne_bids.sidecar_updates import update_sidecar_json, update_anat_landmarks
from mne_bids.inspect import inspect_dataset
from mne_bids.dig import (template_to_head, convert_montage_to_ras,
convert_montage_to_mri)

for example look at BIDSPath in that file --> if it weren't where it is, you would always need to do mne_bids.path.BIDSPath.

And for the API docs, you need to add it here (provided you followed the above):

mne-bids/doc/api.rst

Lines 19 to 22 in b97ce0b

.. autosummary::
:toctree: generated/
write_raw_bids

Thanks @sappelhoff! Added with 1bc097e.


🧐 API and behavior changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down