From 3d79d17c554d47451f5d99221a090164ff159a1b Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Wed, 17 Jul 2024 18:35:38 +0200 Subject: [PATCH 1/2] update pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 45b8364c6..adfda3345 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.1 + rev: v0.5.2 hooks: - id: ruff name: ruff mne_bids/ From 11c1730d2d1279f7480a5d1661cb9a7de43bfd16 Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Wed, 17 Jul 2024 18:36:20 +0200 Subject: [PATCH 2/2] fix warning about doc defs --- mne_bids/path.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mne_bids/path.py b/mne_bids/path.py index 6144e01a4..899205043 100644 --- a/mne_bids/path.py +++ b/mne_bids/path.py @@ -901,7 +901,7 @@ def update(self, *, check=None, **kwargs): If a boolean, controls whether to enforce BIDS conformity. This will set the ``.check`` attribute accordingly. If ``None``, rely on the existing ``.check`` attribute instead, which is set upon - `mne_bids.BIDSPath` instantiation. Defaults to ``None``. + :class:`BIDSPath` instantiation. Defaults to ``None``. **kwargs : dict It can contain updates for valid BIDSPath entities: 'subject', 'session', 'task', 'acquisition', 'processing', 'run', @@ -916,7 +916,7 @@ def update(self, *, check=None, **kwargs): Examples -------- If one creates a bids basename using - :func:`mne_bids.BIDSPath`: + :class:`BIDSPath`: >>> bids_path = BIDSPath(subject='test', session='two', ... task='mytask', suffix='channels', @@ -1018,12 +1018,12 @@ def match(self, ignore_json=True, check=False): check : bool If ``True``, only returns paths that conform to BIDS. If ``False`` (default), the ``.check`` attribute of the returned - `mne_bids.BIDSPath` object will be set to ``True`` for paths that + :class:`BIDSPath` object will be set to ``True`` for paths that do conform to BIDS, and to ``False`` for those that don't. Returns ------- - bids_paths : list of mne_bids.BIDSPath + bids_paths : list of BIDSPath The matching paths. """ if self.root is None: @@ -1122,7 +1122,7 @@ def find_empty_room(self, use_sidecar_only=False, *, verbose=None): """Find the corresponding empty-room file of an MEG recording. This will only work if the ``.root`` attribute of the - :class:`mne_bids.BIDSPath` instance has been set. + :class:`BIDSPath` instance has been set. Parameters ---------- @@ -1581,9 +1581,9 @@ def get_bids_path_from_fname(fname, check=True, verbose=None): Parameters ---------- fname : path-like - The path to parse a `BIDSPath` from. + The path to parse a :class:`BIDSPath` from. check : bool - Whether to check if the generated `BIDSPath` complies with the BIDS + Whether to check if the generated :class:`BIDSPath` complies with the BIDS specification, i.e., whether all included entities and the suffix are valid. %(verbose)s @@ -2382,12 +2382,12 @@ def find_matching_paths( check : bool If ``True``, only returns paths that conform to BIDS. If ``False`` (default), the ``.check`` attribute of the returned - `mne_bids.BIDSPath` object will be set to ``True`` for paths that + :class:`BIDSPath` object will be set to ``True`` for paths that do conform to BIDS, and to ``False`` for those that don't. Returns ------- - bids_paths : list of mne_bids.BIDSPath + bids_paths : list of BIDSPath The matching paths. """ @@ -2459,12 +2459,12 @@ def _fnames_to_bidspaths(fnames, root, check=False): check : bool If ``True``, only returns paths that conform to BIDS. If ``False`` (default), the ``.check`` attribute of the returned - `mne_bids.BIDSPath` object will be set to ``True`` for paths that + :class:`BIDSPath` object will be set to ``True`` for paths that do conform to BIDS, and to ``False`` for those that don't. Returns ------- - bids_paths : list of mne_bids.BIDSPath + bids_paths : list of BIDSPath Bids paths. """