Skip to content

Commit 7594df0

Browse files
authored
Merge pull request #174 from effigies/enh/nipype_submodule
ENH: Import nipype as submodule
2 parents 70a85b9 + 92b51da commit 7594df0

File tree

19 files changed

+69
-58
lines changed

19 files changed

+69
-58
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "niworkflows/nipype"]
2+
path = nipype
3+
url = https://github.com/nipy/nipype.git

circle.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ dependencies:
1515
- mkdir -p ~/data/ ~/docker ${CIRCLE_TEST_REPORTS}/py2 ${CIRCLE_TEST_REPORTS}/py3
1616
- mkdir -p $SCRATCH && sudo setfacl -d -m group:ubuntu:rwx $SCRATCH && sudo setfacl -m group:ubuntu:rwx $SCRATCH
1717
- mkdir -p $SCRATCH/py2 $SCRATCH/py3
18+
- git submodule init && (git submodule update || true)
19+
- git submodule sync && git -C nipype fetch origin && git submodule update
1820
override:
1921
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi :
2022
timeout: 6000
@@ -38,4 +40,4 @@ deployment:
3840
commands:
3941
- sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" niworkflows/info.py
4042
- printf "[distutils]\nindex-servers =\n pypi\n\n[pypi]\nusername:$PYPI_USER\npassword:$PYPI_PASS\n" > ~/.pypirc
41-
- python setup.py sdist upload -r pypi
43+
- python setup.py sdist upload -r pypi

nipype

Submodule nipype added at 9d63943

niworkflows/anat/mni.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
from multiprocessing import cpu_count
1111
from packaging.version import Version
1212

13-
from nipype.interfaces.ants.registration import Registration, RegistrationOutputSpec
14-
from nipype.interfaces.ants.resampling import ApplyTransforms
15-
from nipype.interfaces.ants import AffineInitializer
16-
from nipype.interfaces.base import (traits, isdefined, BaseInterface, BaseInterfaceInputSpec,
17-
File, InputMultiPath)
13+
from niworkflows.nipype.interfaces.ants.registration import Registration, RegistrationOutputSpec
14+
from niworkflows.nipype.interfaces.ants.resampling import ApplyTransforms
15+
from niworkflows.nipype.interfaces.ants import AffineInitializer
16+
from niworkflows.nipype.interfaces.base import (
17+
traits, isdefined, BaseInterface, BaseInterfaceInputSpec, File)
1818

1919
from niworkflows.data import getters
20-
from niworkflows import __packagename__, NIWORKFLOWS_LOG, __version__
21-
22-
niworkflows_version = Version(__version__)
23-
20+
from niworkflows import NIWORKFLOWS_LOG, __version__
2421

2522
import nibabel as nb
2623
import numpy as np
2724

25+
niworkflows_version = Version(__version__)
26+
27+
2828
class RobustMNINormalizationInputSpec(BaseInterfaceInputSpec):
2929
# Enable deprecation
3030
package_version = niworkflows_version

niworkflows/anat/skullstrip.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import, division, print_function, unicode_literals
3-
from nipype.interfaces import ants
4-
from nipype.interfaces import afni
5-
from nipype.interfaces import fsl
6-
from nipype.interfaces import utility as niu
7-
from nipype.pipeline import engine as pe
3+
from niworkflows.nipype.interfaces import ants
4+
from niworkflows.nipype.interfaces import afni
5+
from niworkflows.nipype.interfaces import fsl
6+
from niworkflows.nipype.interfaces import utility as niu
7+
from niworkflows.nipype.pipeline import engine as pe
88

99

1010
def afni_wf(name='AFNISkullStripWorkflow', unifize=False, n4_nthreads=1):

niworkflows/common/orient.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
# @Last Modified time: 2016-11-30 16:25:44
66
from __future__ import absolute_import, division, print_function, unicode_literals
77

8-
from nipype.pipeline import engine as pe
9-
from nipype.interfaces import utility as niu
10-
from nipype.interfaces import afni
8+
from niworkflows.nipype.pipeline import engine as pe
9+
from niworkflows.nipype.interfaces import utility as niu
10+
from niworkflows.nipype.interfaces import afni
11+
1112

1213
def reorient_wf(name='ReorientWorkflow'):
1314
"""A workflow to reorient images to 'RPI' orientation"""

niworkflows/common/report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from abc import abstractmethod
99
from io import open
1010

11-
from nipype.interfaces.base import File, traits, BaseInterface, BaseInterfaceInputSpec, TraitedSpec
11+
from niworkflows.nipype.interfaces.base import (
12+
File, traits, BaseInterface, BaseInterfaceInputSpec, TraitedSpec)
1213
from niworkflows import NIWORKFLOWS_LOG
1314
from nilearn.masking import apply_mask, unmask
1415
from nilearn.image import threshold_img, load_img

niworkflows/info.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"""
1111
from __future__ import absolute_import, division, print_function
1212
import datetime
13+
from os import path as op
14+
import runpy
15+
16+
nipype_info = runpy.run_path(op.join(op.abspath(op.dirname(__file__)),
17+
'nipype', 'info.py'))
1318

1419
__version__ = '0.0.8-dev'
1520
__packagename__ = 'niworkflows'
@@ -39,8 +44,9 @@
3944
'Programming Language :: Python :: 3.5',
4045
]
4146

42-
REQUIRES = ['nipype', 'future', 'nilearn>=0.2.6', 'sklearn', 'pandas', 'matplotlib',
43-
'jinja2', 'svgutils', 'tinycss', 'packaging']
47+
REQUIRES = nipype_info['REQUIRES'] + [
48+
'nilearn>=0.2.6', 'sklearn', 'pandas', 'matplotlib', 'jinja2', 'svgutils',
49+
'tinycss']
4450
SETUP_REQUIRES = []
4551
REQUIRES += SETUP_REQUIRES
4652

niworkflows/interfaces/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# -*- coding: utf-8 -*-
33
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
44
# vi: set ft=python sts=4 ts=4 sw=4 et:
5-
from nipype.interfaces.base import BaseInterface
5+
from __future__ import absolute_import, unicode_literals
6+
7+
from niworkflows.nipype.interfaces.base import BaseInterface
68

79

810
class SimpleInterface(BaseInterface):

niworkflows/interfaces/masks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import os
99

10-
from nilearn.image import mean_img
11-
from nipype.interfaces import fsl, ants
12-
from nipype.interfaces.base import File, BaseInterfaceInputSpec, traits, isdefined
13-
from nipype.algorithms import confounds
10+
from niworkflows.nipype.interfaces import fsl, ants
11+
from niworkflows.nipype.interfaces.base import (
12+
File, BaseInterfaceInputSpec, traits, isdefined)
13+
from niworkflows.nipype.algorithms import confounds
1414
from niworkflows.common import report as nrc
1515
from niworkflows import NIWORKFLOWS_LOG
1616
from nilearn.masking import compute_epi_mask

0 commit comments

Comments
 (0)