-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24.1.0 (October 02, 2024) This new minor release includes a few bug fixes, such as excluding MCRIBS from surface reconstruction without a precomputed segmentation and ensuring generated derivatives are not masked, as well as improvements to reporting. * ENH: Add boilerplate, errors to report (#403) * ENH: Add age to session report (#402) * ENH: Improvements to age parsing (#395, #398) * FIX: MCRIBS auto surface reconstruction logic (#399) * FIX: Do not force masking of anatomicals when using `--derivatives` (#400) * MAINT: Revisit warnings filter (#396) * MAINT: Automate testing with tox (#404) * MAINT: Port over parser arguments and tests from fmriprep (#401)
- Loading branch information
Showing
11 changed files
with
246 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
exclude: ".*/data/.*" | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: '.*\.svg' | ||
- id: end-of-file-fixer | ||
exclude: '.*\.svg' | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-added-large-files | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.5 | ||
hooks: | ||
- id: ruff | ||
args: [ --fix ] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: '.*\.svg' | ||
- id: end-of-file-fixer | ||
exclude: '.*\.svg' | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-added-large-files | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.5 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: | ||
- tomli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from pathlib import Path | ||
from shutil import copytree | ||
from tempfile import TemporaryDirectory | ||
|
||
import pytest | ||
|
||
try: | ||
from contextlib import chdir as _chdir | ||
except ImportError: # PY310 | ||
import os | ||
from contextlib import contextmanager | ||
|
||
@contextmanager # type: ignore | ||
def _chdir(path): | ||
cwd = os.getcwd() | ||
os.chdir(path) | ||
try: | ||
yield | ||
finally: | ||
os.chdir(cwd) | ||
|
||
|
||
DATA_FILES = ( | ||
'functional.nii', | ||
'anatomical.nii', | ||
'func.dlabel.nii', | ||
'func.dtseries.nii', | ||
'epi.nii', | ||
'T1w.nii', | ||
'func_to_struct.mat', | ||
'atlas.nii', | ||
'label_list.txt', | ||
'sub-01_run-01_echo-1_bold.nii.gz', | ||
'sub-01_run-01_echo-2_bold.nii.gz', | ||
'sub-01_run-01_echo-3_bold.nii.gz', | ||
) | ||
|
||
|
||
@pytest.fixture(scope='package') | ||
def data_dir(): | ||
with TemporaryDirectory() as tmpdir: | ||
tmp_path = Path(tmpdir) | ||
for fname in DATA_FILES: | ||
Path.touch(tmp_path / fname) | ||
yield tmp_path | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def _docdir(data_dir, request, tmp_path): | ||
# Trigger ONLY for the doctests. | ||
doctest_plugin = request.config.pluginmanager.getplugin('doctest') | ||
if isinstance(request.node, doctest_plugin.DoctestItem): | ||
copytree(data_dir, tmp_path, dirs_exist_ok=True) | ||
|
||
# Chdir only for the duration of the test. | ||
with _chdir(tmp_path): | ||
yield | ||
|
||
else: | ||
# For normal tests, we have to yield, since this is a yield-fixture. | ||
yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.