Skip to content

Commit 42a7d6d

Browse files
authored
Merge pull request #1832 from oesteban/fix/remove-sklearn-dependency
MAINT: Cleaning up dependencies
2 parents 0d14657 + f825c02 commit 42a7d6d

File tree

13 files changed

+27
-187
lines changed

13 files changed

+27
-187
lines changed

fmriprep/cli/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_parser():
4343
from templateflow.api import templates
4444
from packaging.version import Version
4545
from ..__about__ import __version__
46-
from ..workflows.bold.resampling import NONSTANDARD_REFERENCES
46+
from ..config import NONSTANDARD_REFERENCES
4747
from .version import check_latest, is_flagged
4848

4949
verstr = 'fmriprep v{}'.format(__version__)

fmriprep/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:
3+
"""fMRIPrep settings."""
4+
5+
DEFAULT_MEMORY_MIN_GB = 0.01
6+
NONSTANDARD_REFERENCES = ['anat', 'T1w', 'run', 'func', 'sbref', 'fsnative']

fmriprep/interfaces/nilearn.py

Lines changed: 0 additions & 155 deletions
This file was deleted.

fmriprep/workflows/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from nipype import __version__ as nipype_ver
2020
from nipype.pipeline import engine as pe
2121
from nipype.interfaces import utility as niu
22-
from nilearn import __version__ as nilearn_ver
22+
from niworkflows.interfaces.nilearn import NILEARN_VERSION
2323

2424
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
2525
from niworkflows.interfaces.bids import (
@@ -457,7 +457,7 @@ def init_single_subject_wf(
457457
FreeSurfer SUBJECTS_DIR
458458
459459
"""
460-
from .bold.resampling import NONSTANDARD_REFERENCES
460+
from ..config import NONSTANDARD_REFERENCES
461461
if name in ('single_subject_wf', 'single_subject_fmripreptest_wf'):
462462
# for documentation purposes
463463
subject_data = {
@@ -507,7 +507,7 @@ def init_single_subject_wf(
507507
508508
### References
509509
510-
""".format(nilearn_ver=nilearn_ver)
510+
""".format(nilearn_ver=NILEARN_VERSION)
511511

512512
# Filter out standard spaces to a separate dict
513513
std_spaces = OrderedDict([

fmriprep/workflows/bold/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from niworkflows.interfaces.cifti import GenerateCifti
2424
from niworkflows.interfaces.utils import DictMerge
2525

26+
from ...config import DEFAULT_MEMORY_MIN_GB
2627
from ...utils.meepi import combine_meepi_source
2728

2829
from ...interfaces import DerivativesDataSink
@@ -42,7 +43,7 @@
4243
from .outputs import init_func_derivatives_wf
4344
from .util import init_bold_reference_wf
4445

45-
DEFAULT_MEMORY_MIN_GB = 0.01
46+
4647
LOGGER = logging.getLogger('nipype.workflow')
4748
FSAVERAGE_DENSITY = {
4849
'642': 'fsaverage3',
@@ -266,7 +267,7 @@ def init_func_preproc_wf(
266267
* :py:func:`~fmriprep.workflows.fieldmap.init_nonlinear_sdc_wf`
267268
268269
"""
269-
from .resampling import NONSTANDARD_REFERENCES
270+
from ...config import NONSTANDARD_REFERENCES
270271
from ..fieldmap.base import init_sdc_wf # Avoid circular dependency (#1066)
271272

272273
# Filter out standard spaces to a separate dict

fmriprep/workflows/bold/confounds.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@
3333
TPM2ROI, AddTPMs, AddTSVHeader, TSV2JSON, DictMerge
3434
)
3535

36+
from ...config import DEFAULT_MEMORY_MIN_GB
3637
from ...interfaces import (
3738
GatherConfounds, ICAConfounds,
3839
FMRISummary, DerivativesDataSink
3940
)
4041

41-
DEFAULT_MEMORY_MIN_GB = 0.01
42-
4342

4443
def init_bold_confs_wf(
4544
mem_gb,

fmriprep/workflows/bold/hmc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
1515
from niworkflows.interfaces import NormalizeMotionParams
1616
from niworkflows.interfaces.itk import MCFLIRT2ITK
17-
18-
DEFAULT_MEMORY_MIN_GB = 0.01
17+
from ...config import DEFAULT_MEMORY_MIN_GB
1918

2019

2120
# pylint: disable=R0914

fmriprep/workflows/bold/outputs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
from niworkflows.interfaces.cifti import CiftiNameSource
77
from niworkflows.interfaces.surf import GiftiNameSource
88

9+
from ...config import DEFAULT_MEMORY_MIN_GB
910
from ...interfaces import DerivativesDataSink
1011

1112

12-
DEFAULT_MEMORY_MIN_GB = 0.01
13-
14-
1513
def init_func_derivatives_wf(
1614
bids_root,
1715
cifti_output,

fmriprep/workflows/bold/registration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@
3333
from niworkflows.interfaces.itk import MultiApplyTransforms
3434
from niworkflows.interfaces.registration import FLIRTRPT
3535
from niworkflows.interfaces.utils import GenerateSamplingReference
36+
from niworkflows.interfaces.nilearn import Merge
3637

38+
from ...config import DEFAULT_MEMORY_MIN_GB
3739
from ...interfaces import DerivativesDataSink
38-
from ...interfaces.nilearn import Merge
3940

4041

41-
DEFAULT_MEMORY_MIN_GB = 0.01
42-
4342
LOGGER = logging.getLogger('nipype.workflow')
4443

4544

fmriprep/workflows/bold/resampling.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@
2626
from niworkflows.interfaces.utils import GenerateSamplingReference
2727
from niworkflows.interfaces.utility import KeySelect
2828
from niworkflows.interfaces.surf import GiftiSetAnatomicalStructure
29+
from niworkflows.interfaces.nilearn import Merge
2930

31+
from ...config import DEFAULT_MEMORY_MIN_GB
3032
from ...interfaces import DerivativesDataSink
31-
from ...interfaces.nilearn import Merge
3233

3334
from .util import init_bold_reference_wf
3435

35-
DEFAULT_MEMORY_MIN_GB = 0.01
36-
NONSTANDARD_REFERENCES = ['anat', 'T1w', 'run', 'func', 'sbref', 'fsnative']
37-
3836

3937
def init_bold_surf_wf(mem_gb, output_spaces, medial_surface_nan, name='bold_surf_wf'):
4038
"""

0 commit comments

Comments
 (0)