Skip to content

Commit 3ac78d8

Browse files
committed
Backwards compatibility in #830
1 parent dce38cc commit 3ac78d8

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed
File renamed without changes.

nipype/algorithms/misc.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828

2929
from .. import logging
3030

31-
from .. import warnings
32-
warnings.warn('Evaluation interfaces (Distance, Overlap, FuzzyOverlap)
33-
have been moved to nipype.algorithms.eval' )
31+
import warnings
3432

33+
import metrics as nam
3534
from ..interfaces.base import (BaseInterface, traits, TraitedSpec, File,
3635
InputMultiPath, OutputMultiPath,
3736
BaseInterfaceInputSpec, isdefined)
@@ -842,3 +841,20 @@ def calc_moments(timeseries_file, moment):
842841
m3 = stats.moment(timeseries, moment, axis=0)
843842
zero = (m2 == 0)
844843
return np.where(zero, 0, m3 / m2**(moment/2.0))
844+
845+
# Deprecated interfaces ---------------------------------------------------------
846+
class Distance( nam.Distance ):
847+
def __init__(self, **inputs):
848+
super(nam.Distance, self).__init__(**inputs)
849+
warnings.warn("This interface has been moved from misc to metrics", DeprecationWarning)
850+
851+
class Overlap( nam.Overlap ):
852+
def __init__(self, **inputs):
853+
super(nam.Overlap, self).__init__(**inputs)
854+
warnings.warn("This interface has been moved from misc to metrics", DeprecationWarning)
855+
856+
857+
class FuzzyOverlap( nam.FuzzyOverlap ):
858+
def __init__(self, **inputs):
859+
super(nam.FuzzyOverlap, self).__init__(**inputs)
860+
warnings.warn("This interface has been moved from misc to metrics", DeprecationWarning)

nipype/algorithms/tests/test_auto_Distance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
22
from nipype.testing import assert_equal
3-
from nipype.algorithms.eval import Distance
3+
from nipype.algorithms.misc import Distance
44

55
def test_Distance_inputs():
66
input_map = dict(ignore_exception=dict(nohash=True,

nipype/algorithms/tests/test_auto_ErrorMap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
22
from nipype.testing import assert_equal
3-
from nipype.algorithms.eval import ErrorMap
3+
from nipype.algorithms.metrics import ErrorMap
44

55
def test_ErrorMap_inputs():
66
input_map = dict(ignore_exception=dict(nohash=True,

nipype/algorithms/tests/test_auto_FuzzyOverlap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
22
from nipype.testing import assert_equal
3-
from nipype.algorithms.eval import FuzzyOverlap
3+
from nipype.algorithms.misc import FuzzyOverlap
44

55
def test_FuzzyOverlap_inputs():
66
input_map = dict(ignore_exception=dict(nohash=True,

nipype/algorithms/tests/test_auto_Overlap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
22
from nipype.testing import assert_equal
3-
from nipype.algorithms.eval import Overlap
3+
from nipype.algorithms.misc import Overlap
44

55
def test_Overlap_inputs():
66
input_map = dict(ignore_exception=dict(nohash=True,

0 commit comments

Comments
 (0)