Skip to content

Commit ceb4049

Browse files
committed
MNT: Remove minc.py
1 parent 65e4453 commit ceb4049

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

nibabel/__init__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ def teardown_package():
7878
from .minc2 import Minc2Image
7979
from .cifti2 import Cifti2Header, Cifti2Image
8080
from .gifti import GiftiImage
81-
# Deprecated backwards compatiblity for MINC1
82-
from .deprecated import ModuleProxy as _ModuleProxy
83-
minc = _ModuleProxy('nibabel.minc')
8481
from .minc1 import MincImage
8582
from .freesurfer import MGHImage
8683
from .funcs import (squeeze_image, concat_images, four_to_three,
@@ -89,6 +86,7 @@ def teardown_package():
8986
flip_axis, OrientationError,
9087
apply_orientation, aff2axcodes)
9188
from .imageclasses import class_map, ext_map, all_image_classes
89+
from .deprecated import ModuleProxy as _ModuleProxy
9290
trackvis = _ModuleProxy('nibabel.trackvis')
9391
from . import mriutils
9492
from . import streamlines

nibabel/minc.py

-10
This file was deleted.

nibabel/tests/test_minc1.py

-20
Original file line numberDiff line numberDiff line change
@@ -104,30 +104,10 @@ def test_old_namespace():
104104
# Check warnings raised
105105
arr = np.arange(24).reshape((2, 3, 4))
106106
aff = np.diag([2, 3, 4, 1])
107-
with clear_and_catch_warnings() as warns:
108-
warnings.simplefilter('always', DeprecationWarning)
109-
# Top level import.
110-
# This import does not trigger an import of the minc.py module, because
111-
# it's the proxy object.
112-
from .. import minc
113-
assert_equal(warns, [])
114-
# If there was a previous import it will be module, otherwise it will be
115-
# a proxy
116-
previous_import = isinstance(minc, types.ModuleType)
117-
if not previous_import:
118-
assert_true(isinstance(minc, ModuleProxy))
119-
old_minc1image = minc.Minc1Image # just to check it works
120-
# There may or may not be a warning raised on accessing the proxy,
121-
# depending on whether the minc.py module is already imported in this
122-
# test run.
123-
if not previous_import:
124-
assert_equal(warns.pop(0).category, DeprecationWarning)
125107

126108
with clear_and_catch_warnings() as warns:
127109
from .. import Minc1Image, MincImage
128110
assert_equal(warns, [])
129-
# The import from old module is the same as that from new
130-
assert_true(old_minc1image is Minc1Image)
131111
# But the old named import, imported from new, is not the same
132112
assert_false(Minc1Image is MincImage)
133113
assert_equal(warns, [])

0 commit comments

Comments
 (0)