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

MNT: Update tedana pin, test on Python 3.12 #3141

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
install: ['pip']
check: ['tests']
pip-flags: ['PRE_PIP_FLAGS']
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
install: ['pip']
check: ['tests']
pip-flags: ['']
Expand Down
4 changes: 2 additions & 2 deletions fmriprep/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
_copy_any(dseg_tsv, str(config.execution.fmriprep_dir / "desc-aparcaseg_dseg.tsv"))
errno = 0
finally:
from pkg_resources import resource_filename as pkgrf
from .. import data

Check warning on line 205 in fmriprep/cli/run.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/cli/run.py#L205

Added line #L205 was not covered by tests

# Code Carbon
if config.execution.track_carbon:
Expand All @@ -218,7 +218,7 @@
config.execution.participant_label,
config.execution.fmriprep_dir,
config.execution.run_uuid,
config=pkgrf("fmriprep", "data/reports-spec.yml"),
config=data.load("reports-spec.yml"),
packagename="fmriprep",
)
write_derivative_description(config.execution.bids_dir, config.execution.fmriprep_dir)
Expand Down
11 changes: 5 additions & 6 deletions fmriprep/cli/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@

from niworkflows.utils.bids import collect_participants
from niworkflows.utils.misc import check_valid_fs_license
from pkg_resources import resource_filename as pkgrf

from fmriprep.reports.core import generate_reports
from fmriprep.utils.bids import check_pipeline_version

from .. import config
from .. import config, data

Check warning on line 45 in fmriprep/cli/workflow.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/cli/workflow.py#L45

Added line #L45 was not covered by tests
from ..utils.misc import check_deps
from ..workflows.base import init_fmriprep_wf

Expand All @@ -57,7 +56,7 @@
retval["workflow"] = None

banner = [f"Running fMRIPrep version {version}"]
notice_path = Path(pkgrf("fmriprep", "data/NOTICE"))
notice_path = data.load.readable("NOTICE")

Check warning on line 59 in fmriprep/cli/workflow.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/cli/workflow.py#L59

Added line #L59 was not covered by tests
if notice_path.exists():
banner[0] += "\n"
banner += [f"License NOTICE {'#' * 50}"]
Expand Down Expand Up @@ -91,7 +90,7 @@
config.execution.participant_label,
config.execution.fmriprep_dir,
config.execution.run_uuid,
config=pkgrf("fmriprep", "data/reports-spec.yml"),
config=data.load("reports-spec.yml"),
packagename="fmriprep",
)
return retval
Expand Down Expand Up @@ -183,9 +182,9 @@
from pathlib import Path
from subprocess import CalledProcessError, TimeoutExpired, check_call

from pkg_resources import resource_filename as pkgrf
from .. import data

Check warning on line 185 in fmriprep/cli/workflow.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/cli/workflow.py#L185

Added line #L185 was not covered by tests

bib_text = Path(pkgrf("fmriprep", "data/boilerplate.bib")).read_text()
bib_text = data.load.readable("boilerplate.bib").read_text()

Check warning on line 187 in fmriprep/cli/workflow.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/cli/workflow.py#L187

Added line #L187 was not covered by tests
citation_files["bib"].write_text(
bib_text.replace("fMRIPrep <version>", f"fMRIPrep {config.environment.version}")
)
Expand Down
6 changes: 2 additions & 4 deletions fmriprep/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@

import pytest
from niworkflows.utils.spaces import format_reference
from pkg_resources import resource_filename as pkgrf
from toml import loads

from .. import config
from .. import config, data


def _reset_config():
Expand Down Expand Up @@ -59,8 +58,7 @@ def test_reset_config():

def test_config_spaces():
"""Check that all necessary spaces are recorded in the config."""
filename = Path(pkgrf('fmriprep', 'data/tests/config.toml'))
settings = loads(filename.read_text())
settings = loads(data.load.readable("tests/config.toml").read_text())
for sectionname, configs in settings.items():
if sectionname != 'environment':
section = getattr(config, sectionname)
Expand Down
5 changes: 2 additions & 3 deletions fmriprep/workflows/bold/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
import os.path as op
import typing as ty

import pkg_resources as pkgr
from nipype.interfaces import c3, fsl
from nipype.interfaces import utility as niu
from nipype.pipeline import engine as pe

from ... import config
from ... import config, data
from ...interfaces import DerivativesDataSink

DEFAULT_MEMORY_MIN_GB = config.DEFAULT_MEMORY_MIN_GB
Expand Down Expand Up @@ -588,7 +587,7 @@
else:
# Should mostly be hit while building docs
LOGGER.warning("FSLDIR unset - using packaged BBR schedule")
flt_bbr.inputs.schedule = pkgr.resource_filename('fmriprep', 'data/flirtsch/bbr.sch')
flt_bbr.inputs.schedule = data.load('flirtsch/bbr.sch')

Check warning on line 590 in fmriprep/workflows/bold/registration.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/registration.py#L590

Added line #L590 was not covered by tests
# fmt:off
workflow.connect([
(inputnode, wm_mask, [('t1w_dseg', 'in_seg')]),
Expand Down
8 changes: 4 additions & 4 deletions fmriprep/workflows/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
from pathlib import Path
from tempfile import mkdtemp

from pkg_resources import resource_filename as pkgrf
from toml import loads

from ... import data


@contextmanager
def mock_config():
Expand All @@ -40,8 +41,7 @@
if not _old_fs:
os.environ['FREESURFER_HOME'] = mkdtemp()

filename = Path(pkgrf('fmriprep', 'data/tests/config.toml'))
settings = loads(filename.read_text())
settings = loads(data.load.readable('tests/config.toml').read_text())

Check warning on line 44 in fmriprep/workflows/tests/__init__.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/tests/__init__.py#L44

Added line #L44 was not covered by tests
for sectionname, configs in settings.items():
if sectionname != 'environment':
section = getattr(config, sectionname)
Expand All @@ -52,7 +52,7 @@
config.init_spaces()

config.execution.work_dir = Path(mkdtemp())
config.execution.bids_dir = Path(pkgrf('fmriprep', 'data/tests/ds000005')).absolute()
config.execution.bids_dir = data.load('tests/ds000005').absolute()

Check warning on line 55 in fmriprep/workflows/tests/__init__.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/tests/__init__.py#L55

Added line #L55 was not covered by tests
config.execution.fmriprep_dir = Path(mkdtemp())
config.execution.init()

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
license = {file = "LICENSE"}
requires-python = ">=3.10"
Expand All @@ -31,9 +32,9 @@ dependencies = [
"psutil >= 5.4",
"pybids >= 0.15.2",
"requests",
"sdcflows @ git+https://github.com/nipreps/sdcflows.git@master",
"sdcflows @ git+https://github.com/nipreps/sdcflows.git@master",
"smriprep @ git+https://github.com/nipreps/smriprep.git@master",
"tedana >= 0.0.9",
"tedana >= 23.0.2",
"templateflow >= 23.0.0",
"toml",
"codecarbon",
Expand Down
50 changes: 28 additions & 22 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ attrs==23.1.0
# sdcflows
bids-validator==1.13.1
# via pybids
bokeh==2.2.3
bokeh==3.3.1
# via tedana
boto==2.49.0
# via datalad
certifi==2023.7.22
certifi==2023.11.17
# via
# requests
# sentry-sdk
Expand All @@ -51,7 +51,9 @@ codecarbon==2.3.1
# fmriprep
# fmriprep (pyproject.toml)
contourpy==1.2.0
# via matplotlib
# via
# bokeh
# matplotlib
cryptography==41.0.5
# via secretstorage
cycler==0.12.1
Expand All @@ -75,7 +77,7 @@ fasteners==0.19
# via datalad
filelock==3.13.1
# via nipype
fonttools==4.44.0
fonttools==4.45.0
# via matplotlib
formulaic==0.5.2
# via pybids
Expand All @@ -91,7 +93,7 @@ humanize==4.8.0
# datalad-next
idna==3.4
# via requests
imageio==2.32.0
imageio==2.33.0
# via scikit-image
importlib-metadata==6.8.0
# via keyring
Expand All @@ -116,11 +118,10 @@ jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.0.1
jinja2==3.1.2
# via
# bokeh
# niworkflows
# tedana
joblib==1.3.2
# via
# nilearn
Expand Down Expand Up @@ -152,16 +153,18 @@ mapca==0.0.4
# via tedana
markupsafe==2.1.3
# via jinja2
matplotlib==3.8.1
matplotlib==3.8.2
# via
# nireports
# nitime
# niworkflows
# seaborn
# smriprep
# tedana
migas==0.3.0
# via fmriprep
migas==0.4.0
# via
# file:///home/chris/projects/nipreps/fmriprep-ng
# fmriprep
more-itertools==10.1.0
# via jaraco-classes
msgpack==1.0.7
Expand Down Expand Up @@ -213,7 +216,7 @@ nitransforms==23.0.1
# fmriprep (pyproject.toml)
# niworkflows
# sdcflows
niworkflows==1.8.1
niworkflows==1.9.0
# via
# fmriprep
# fmriprep (pyproject.toml)
Expand Down Expand Up @@ -267,6 +270,7 @@ packaging==23.2
# smriprep
pandas==2.1.3
# via
# bokeh
# codecarbon
# fmriprep
# fmriprep (pyproject.toml)
Expand All @@ -277,17 +281,17 @@ pandas==2.1.3
# pybids
# seaborn
# tedana
patool==1.15.0
patool==2.0.0
# via datalad
pillow==10.0.1
pillow==10.1.0
# via
# bokeh
# imageio
# matplotlib
# scikit-image
platformdirs==4.0.0
# via datalad
prometheus-client==0.18.0
prometheus-client==0.19.0
# via codecarbon
prov==2.0.0
# via nipype
Expand Down Expand Up @@ -321,7 +325,6 @@ pyparsing==3.1.1
python-dateutil==2.8.2
# via
# arrow
# bokeh
# matplotlib
# nipype
# pandas
Expand Down Expand Up @@ -365,7 +368,7 @@ scikit-learn==1.3.2
# mapca
# nilearn
# tedana
scipy==1.11.3
scipy==1.11.4
# via
# formulaic
# mapca
Expand All @@ -379,7 +382,7 @@ scipy==1.11.3
# scikit-learn
# sdcflows
# tedana
sdcflows==2.5.1
sdcflows==2.6.0
# via
# fmriprep
# fmriprep (pyproject.toml)
Expand All @@ -389,8 +392,10 @@ seaborn==0.13.0
# niworkflows
secretstorage==3.3.3
# via keyring
sentry-sdk==1.35.0
# via fmriprep
sentry-sdk==1.36.0
# via
# file:///home/chris/projects/nipreps/fmriprep-ng
# fmriprep
simplejson==3.19.2
# via nipype
six==1.16.0
Expand All @@ -399,7 +404,7 @@ six==1.16.0
# isodate
# osfclient
# python-dateutil
smriprep==0.12.2
smriprep==0.13.0
# via
# fmriprep
# fmriprep (pyproject.toml)
Expand All @@ -409,7 +414,7 @@ svgutils==0.3.4
# via
# nireports
# niworkflows
tedana==23.0.1
tedana==23.0.2
# via
# fmriprep
# fmriprep (pyproject.toml)
Expand Down Expand Up @@ -449,7 +454,6 @@ types-python-dateutil==2.8.19.14
# via arrow
typing-extensions==4.8.0
# via
# bokeh
# datalad
# formulaic
# sqlalchemy
Expand All @@ -463,5 +467,7 @@ urllib3==2.1.0
# sentry-sdk
wrapt==1.16.0
# via formulaic
xyzservices==2023.10.1
# via bokeh
zipp==3.17.0
# via importlib-metadata