Skip to content

Commit cc7a10b

Browse files
authored
Merge pull request #1392 from FCP-INDI/upgrade/nipype-1.5.1
⬆️ Upgrade Nipype to v1.5.1 (from 1.1.2)
2 parents f136ed8 + 3e8c31f commit cc7a10b

File tree

50 files changed

+210
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+210
-114
lines changed

.circleci/config.yml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ commands:
1515
- run:
1616
name: "Setting Python Version"
1717
command: |
18-
pyenv install 3.6.3
19-
pyenv global 3.6.3
18+
cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd -
19+
pyenv install -v 3.9.0
20+
pyenv global 3.9.0
2021
install-singularity-requirements:
2122
steps:
2223
- run:
2324
name: "Installing Singularity requirements"
2425
command: |
25-
sudo apt-get update && sudo apt-get install flawfinder squashfs-tools uuid-dev libuuid1 libffi-dev libssl-dev libssl1.0.0 libarchive-dev libgpgme11-dev libseccomp-dev -y
26+
sudo apt-get update && sudo apt-get install flawfinder squashfs-tools uuid-dev libuuid1 libffi-dev libssl-dev libssl1.1 libarchive-dev libgpgme11-dev libseccomp-dev -y
2627
set-up-singularity:
2728
steps:
2829
- run:
@@ -87,7 +88,8 @@ commands:
8788
8889
jobs:
8990
pytest-docker:
90-
machine: true
91+
machine:
92+
image: ubuntu-2004:202010-01
9193
steps:
9294
- attach_workspace:
9395
# Must be absolute path or relative path from working_directory
@@ -111,7 +113,8 @@ jobs:
111113
path: htmlcov
112114
no_output_timeout: 5h
113115
pytest-singularity:
114-
machine: true
116+
machine:
117+
image: ubuntu-2004:202010-01
115118
steps:
116119
- attach_workspace:
117120
# Must be absolute path or relative path from working_directory
@@ -126,7 +129,8 @@ jobs:
126129
pip install -r dev/circleci_data/requirements.txt
127130
coverage run -m pytest --junitxml=test-results/junit.xml --continue-on-collection-errors dev/circleci_data/test_install.py
128131
build:
129-
machine: true
132+
machine:
133+
image: ubuntu-2004:202010-01
130134
steps:
131135
- checkout
132136
- set-python-version
@@ -135,32 +139,20 @@ jobs:
135139
name: "Checking if version needs updated"
136140
# update version if version needs updated, otherwise just move on
137141
command: |
138-
if [[ ! $(git log -1 --pretty=%B) == *"Update version to"* ]]
142+
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
143+
if [[ ! "$COMMIT_MESSAGE" == *"Update version to"* ]]
139144
then
140145
cd $HOME/project/CPAC
141-
VERSION=$(python -c "from info import __version__; print(__version__)")
146+
VERSION=$(python -c "from info import __version__; print('.'.join(('.'.join(__version__[::-1].split('-')[1].split('.')[1:])[::-1], __version__.split('-')[1])) if '-' in __version__ else __version__)")
142147
cd ..
143-
if ! [[ $CIRCLE_BRANCH = 'master' ]]
144-
then
145-
git fetch --all
146-
if [[ -n ${CIRCLE_PR_NUMBER} && -n ${GITHUB_PR_BASE_TOKEN} ]]
147-
then
148-
curl -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -o jq
149-
chmod +x jq
150-
REBASE_BASE=origin/$(curl -u shnizzedy:$GITHUB_PR_BASE_TOKEN "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER" | jq '.base.ref' | tr -d '"')
151-
else
152-
REBASE_BASE=$(git rev-parse --short HEAD~30)
153-
fi
154-
GIT_SEQUENCE_EDITOR=dev/circleci_data/drop_version_bump_commits git rebase -X ours -i $REBASE_BASE --empty drop
155-
fi
156148
echo "v${VERSION}" > version
157149
sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" dev/docker_data/default_pipeline.yml
158150
find ./CPAC/resources/configs -name "*.yml" -exec sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" {} \;
159151
git add version CPAC/resources/configs dev/docker_data/default_pipeline.yml
160152
if [[ ! -z $(git diff origin/${CIRCLE_BRANCH}) ]]
161153
then
162-
git commit -m ":bookmark: Update version to ${VERSION}"
163-
git push origin HEAD:${CIRCLE_BRANCH} -f || true
154+
git commit -m ":bookmark: Update version to ${VERSION} ($COMMIT_MESSAGE)"
155+
git push origin HEAD:${CIRCLE_BRANCH} || true
164156
circleci step halt
165157
fi
166158
cd ..
@@ -177,4 +169,4 @@ workflows:
177169
- build
178170
- pytest-singularity:
179171
requires:
180-
- build
172+
- build

CPAC/info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# version
1111
_version_major = 1
1212
_version_minor = 7
13-
_version_micro = 1
14-
_version_extra = ''
13+
_version_micro = 3
14+
_version_extra = 'dev'
1515

1616

1717
def get_cpac_gitversion():
@@ -146,7 +146,7 @@ def get_cpac_gitversion():
146146
"networkx==2.4",
147147
"nibabel==2.3.3",
148148
"nilearn==0.4.1",
149-
"nipype==1.1.2",
149+
"nipype==1.5.1",
150150
"nose==1.3.7",
151151
"numpy==1.16.4",
152152
"pandas==0.23.4",

CPAC/nuisance/nuisance.py

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,30 @@
22
import os
33
import numpy as np
44
import nibabel as nb
5-
65
import nipype.pipeline.engine as pe
76
import nipype.interfaces.utility as util
8-
import nipype.interfaces.fsl as fsl
9-
import nipype.interfaces.ants as ants
10-
import nipype.interfaces.c3 as c3
7+
import CPAC
8+
9+
from nipype.interfaces import fsl
10+
from nipype.interfaces import ants
11+
from nipype.interfaces import c3
1112
from nipype.interfaces import afni
1213
from nipype.interfaces.afni import utils as afni_utils
13-
14-
import CPAC
15-
import CPAC.utils as utils
14+
from scipy.fftpack import fft, ifft
15+
from CPAC import utils
1616
from CPAC.utils.interfaces.function import Function
1717
from CPAC.utils.interfaces.masktool import MaskTool
1818
from CPAC.utils.interfaces.pc import PC
19-
2019
from CPAC.nuisance.utils import (
2120
find_offending_time_points,
2221
generate_summarize_tissue_mask,
23-
temporal_variance_mask,
24-
calc_compcor_components
25-
)
26-
22+
temporal_variance_mask)
2723
from CPAC.nuisance.utils.compcor import (
2824
calc_compcor_components,
2925
cosine_filter,
3026
TR_string_to_float)
31-
32-
3327
from CPAC.utils.datasource import check_for_s3
34-
35-
from scipy.fftpack import fft, ifft
36-
3728
from .bandpass import bandpass_voxels
38-
import nipype.pipeline.engine as pe
39-
import nipype.interfaces.utility as util
40-
import nipype.interfaces.fsl as fsl
41-
import nipype.interfaces.ants as ants
4229

4330

4431
def gather_nuisance(functional_file_path,
@@ -1212,10 +1199,10 @@ def create_regressor_workflow(nuisance_selectors,
12121199

12131200
nuisance_wf.connect(
12141201
union_masks_paths, 'out_file',
1215-
mean_node, 'mask'
1202+
mean_node, 'mask_file'
12161203
)
12171204

1218-
summary_method_input = (mean_node, 'stats')
1205+
summary_method_input = (mean_node, 'out_file')
12191206

12201207
if 'PC' in summary_method:
12211208

CPAC/pipeline/cpac_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ def run_workflow(sub_dict, c, run, pipeline_timing_info=None, p_name=None,
401401
log_nodes_initial(workflow)
402402

403403
# Add status callback function that writes in callback log
404-
if nipype.__version__ not in ('1.1.2'):
404+
if nipype.__version__ not in ('1.5.1'):
405405
err_msg = "This version of Nipype may not be compatible with " \
406-
"CPAC v%s, please install Nipype version 1.1.2\n" \
406+
"CPAC v%s, please install Nipype version 1.5.1\n" \
407407
% (CPAC.__version__)
408408
logger.error(err_msg)
409409
else:

CPAC/resources/configs/data_config_S3-BIDS-ABIDE.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CPAC Data Configuration File
2-
# Version 1.7.1
2+
# Version 1.7.3.dev
33
#
44
# http://fcp-indi.github.io for more info.
55
#

CPAC/resources/configs/data_config_S3-BIDS-ADHD200.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CPAC Data Configuration File
2-
# Version 1.7.1
2+
# Version 1.7.3.dev
33
#
44
# http://fcp-indi.github.io for more info.
55
#

CPAC/resources/configs/data_config_S3-BIDS-ADHD200_only2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CPAC Data Configuration File
2-
# Version 1.7.1
2+
# Version 1.7.3.dev
33
#
44
# http://fcp-indi.github.io for more info.
55
#

CPAC/resources/configs/data_config_S3-BIDS-NKI-RocklandSample.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CPAC Data Configuration File
2-
# Version 1.7.1
2+
# Version 1.7.3.dev
33
#
44
# http://fcp-indi.github.io for more info.
55
#

CPAC/resources/configs/data_config_cpac_benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CPAC Data Configuration File
2-
# Version 1.7.1
2+
# Version 1.7.3.dev
33
#
44
# http://fcp-indi.github.io for more info.
55
#

CPAC/resources/configs/data_settings_template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CPAC Data Settings File
2-
# Version 1.7.1
2+
# Version 1.7.3.dev
33
#
44
# http://fcp-indi.github.io for more info.
55
#

0 commit comments

Comments
 (0)