From a3bdd6b65a9c467b1d4b9dc3f4e8d7a0d3331bca Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 26 Sep 2023 14:04:36 -0400 Subject: [PATCH 01/10] Bump to Python 3.9. --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 05c4c84a2..6adc34fed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,12 +12,12 @@ classifiers = [ "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Image Recognition", "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] license = {file = "LICENSE.md"} -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ - 'importlib_resources; python_version < "3.9"', + 'importlib_resources; python_version < "3.10"', "indexed_gzip >= 0.8.8", "jinja2 < 3.1", "looseversion == 1.0.3", From 84ed62fcce8a62842e89169a98ea99645fbb9a1f Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 26 Sep 2023 14:04:45 -0400 Subject: [PATCH 02/10] Remove unused dependencies. --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6adc34fed..ef98eee76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,6 @@ dependencies = [ "niflow-nipype1-workflows", "nilearn == 0.10.0", "nipype >= 1.8.5", - "nitime", "nitransforms >= 21.0.0", "niworkflows ~= 1.7.3", "numpy >= 1.17.3", @@ -34,7 +33,6 @@ dependencies = [ "patsy", "psutil >= 5.4", "pybids >= 0.13.2", - "pyslim", "pyyaml", "sdcflows", "sentry-sdk >= 0.6.9", From 94b64efd30116648267f836b3def576d7da58006 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 26 Sep 2023 16:30:17 -0400 Subject: [PATCH 03/10] Update lint.yml --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 73eb1efea..635cf2003 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,6 @@ jobs: run: python -m pip install \ flake8 flake8-absolute-import flake8-black flake8-docstrings \ flake8-isort flake8-pyproject flake8-unused-arguments \ - flake8-use-fstring flake8-warnings pep8-naming + flake8-use-fstring pep8-naming - name: Check aslprep run: python -m flake8 aslprep From 3fb5a232eff593d636858d867912150a2d2deb5f Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 26 Sep 2023 16:47:44 -0400 Subject: [PATCH 04/10] Update asl.py --- aslprep/utils/asl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aslprep/utils/asl.py b/aslprep/utils/asl.py index da557fb8e..95d2d6336 100644 --- a/aslprep/utils/asl.py +++ b/aslprep/utils/asl.py @@ -44,7 +44,11 @@ def select_processing_target(aslcontext): """Determine how to handle ASL and M0 data based on dataset configuration.""" import pandas as pd - aslcontext_df = pd.read_table(aslcontext) + try: + aslcontext_df = pd.read_table(aslcontext) + except: + raise ValueError(aslcontext) + voltypes = aslcontext_df["volume_type"].tolist() if "control" in voltypes and "label" in voltypes: From b53ce433a029eb5be9ae8f345dd658f992ab8821 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 26 Sep 2023 17:29:16 -0400 Subject: [PATCH 05/10] Copy some stuff from fMRIPrep. --- aslprep/config.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/aslprep/config.py b/aslprep/config.py index 04977aac1..3e728d330 100644 --- a/aslprep/config.py +++ b/aslprep/config.py @@ -390,23 +390,43 @@ def init(cls): import re from bids.layout import BIDSLayout + from bids.layout.index import BIDSLayoutIndexer - work_dir = cls.work_dir / "bids.db" - work_dir.mkdir(exist_ok=True, parents=True) - cls._layout = BIDSLayout( - str(cls.bids_dir), + _db_path = cls.bids_database_dir or (cls.work_dir / cls.run_uuid / "bids_db") + _db_path.mkdir(exist_ok=True, parents=True) + + # Recommended after PyBIDS 12.1 + _indexer = BIDSLayoutIndexer( validate=False, - # database_path=str(work_dir), ignore=( "code", "stimuli", "sourcedata", "models", - "derivatives", re.compile(r"^\."), + re.compile( + r"sub-[a-zA-Z0-9]+(/ses-[a-zA-Z0-9]+)?/(beh|dwi|eeg|ieeg|meg|func)" + ), ), ) + cls._layout = BIDSLayout( + str(cls.bids_dir), + database_path=_db_path, + reset_database=cls.bids_database_dir is None, + indexer=_indexer, + ) + cls.bids_database_dir = _db_path + cls.layout = cls._layout + if cls.bids_filters: + from bids.layout import Query + + # unserialize pybids Query enum values + for acq, filters in cls.bids_filters.items(): + cls.bids_filters[acq] = { + k: getattr(Query, v[7:-4]) if not isinstance(v, Query) and "Query" in v else v + for k, v in filters.items() + } # These variables are not necessary anymore From f4d345db38f56ebb8b72892442d953697ff3ae7a Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 27 Sep 2023 09:09:14 -0400 Subject: [PATCH 06/10] Drop database dir. --- aslprep/config.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/aslprep/config.py b/aslprep/config.py index 3e728d330..48253a79a 100644 --- a/aslprep/config.py +++ b/aslprep/config.py @@ -392,9 +392,6 @@ def init(cls): from bids.layout import BIDSLayout from bids.layout.index import BIDSLayoutIndexer - _db_path = cls.bids_database_dir or (cls.work_dir / cls.run_uuid / "bids_db") - _db_path.mkdir(exist_ok=True, parents=True) - # Recommended after PyBIDS 12.1 _indexer = BIDSLayoutIndexer( validate=False, @@ -411,11 +408,8 @@ def init(cls): ) cls._layout = BIDSLayout( str(cls.bids_dir), - database_path=_db_path, - reset_database=cls.bids_database_dir is None, indexer=_indexer, ) - cls.bids_database_dir = _db_path cls.layout = cls._layout if cls.bids_filters: From ccf4f628291eb53169081ad978db054f754595c8 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 27 Sep 2023 09:36:12 -0400 Subject: [PATCH 07/10] Update base.py --- aslprep/workflows/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aslprep/workflows/base.py b/aslprep/workflows/base.py index 4a660bc3f..d9e73856b 100644 --- a/aslprep/workflows/base.py +++ b/aslprep/workflows/base.py @@ -109,7 +109,7 @@ def init_single_subject_wf(subject_id): """ name = f"single_subject_{subject_id}_wf" subject_data, layout = collect_data( - config.execution.bids_dir, + config.execution._layout, subject_id, bids_filters=config.execution.bids_filters, ) From 47b86eeef8ccca82687b4cf0bb684dad20b206a1 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 27 Sep 2023 10:11:54 -0400 Subject: [PATCH 08/10] Try out new regex. --- aslprep/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aslprep/config.py b/aslprep/config.py index 48253a79a..ce51f3656 100644 --- a/aslprep/config.py +++ b/aslprep/config.py @@ -400,7 +400,7 @@ def init(cls): "stimuli", "sourcedata", "models", - re.compile(r"^\."), + re.compile(r"\/\.\w+|^\.\w+"), re.compile( r"sub-[a-zA-Z0-9]+(/ses-[a-zA-Z0-9]+)?/(beh|dwi|eeg|ieeg|meg|func)" ), From e220b32e18de8d2d2b6babf106cdc0281b9499d6 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 27 Sep 2023 10:44:11 -0400 Subject: [PATCH 09/10] Require nipy dependencies for nipype. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ef98eee76..69ecf26b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "nibabel >= 3.0", "niflow-nipype1-workflows", "nilearn == 0.10.0", - "nipype >= 1.8.5", + "nipype[nipy] >= 1.8.5", "nitransforms >= 21.0.0", "niworkflows ~= 1.7.3", "numpy >= 1.17.3", From 455a384cebcaaf43f52627ce431fafc3f8893228 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 27 Sep 2023 15:23:05 -0400 Subject: [PATCH 10/10] Update .readthedocs.yaml --- .readthedocs.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c84fd5319..46b7c5c37 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,19 +3,11 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py -build: - os: ubuntu-22.04 - tools: - python: "3.8" - jobs: - post_checkout: - - git fetch --unshallow - python: install: - method: pip