diff --git a/dipy/data/__init__.py b/dipy/data/__init__.py index abe68e7067..9957646d92 100644 --- a/dipy/data/__init__.py +++ b/dipy/data/__init__.py @@ -362,6 +362,9 @@ def mrtrix_spherical_functions(): def get_cmap(name): """Makes a callable, similar to maptlotlib.pyplot.get_cmap""" + if name.lower() == "accent": + raise ValueError("The `Accent` colormap is deprecated as of version", + " 0.12 of Dipy. Please use another colormap") global dipy_cmaps if dipy_cmaps is None: filename = pjoin(DATA_DIR, "dipy_colormaps.json") diff --git a/dipy/viz/tests/test_fvtk.py b/dipy/viz/tests/test_fvtk.py index 5efe8eb6e5..fff9476add 100644 --- a/dipy/viz/tests/test_fvtk.py +++ b/dipy/viz/tests/test_fvtk.py @@ -109,7 +109,7 @@ def test_colormap(): @npt.dec.skipif(not fvtk.have_matplotlib) def test_colormaps_matplotlib(): v = np.random.random(1000) - for name in 'jet', 'Blues', 'Accent', 'bone': + for name in 'jet', 'Blues', 'bone': # Matplotlib version of get_cmap rgba1 = fvtk.get_cmap(name)(v) # Dipy version of get_cmap @@ -117,6 +117,9 @@ def test_colormaps_matplotlib(): # dipy's colormaps are close to matplotlibs colormaps, but not perfect npt.assert_array_almost_equal(rgba1, rgba2, 1) + # The "Accent" colormap is deprecated as of 0.12: + npt.assert_raises(ValueError, data.get_cmap, 'Accent') + if __name__ == "__main__":