New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colormap test errors for new matplotlib #1188

Closed
matthew-brett opened this Issue Mar 7, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@matthew-brett
Member

matthew-brett commented Mar 7, 2017

Test error when testing against latest matplotlib:

======================================================================
FAIL: dipy.viz.tests.test_fvtk.test_colormaps_matplotlib
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matthew-brett/dipy/venv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matthew-brett/dipy/venv/lib/python2.7/site-packages/numpy/testing/decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "/home/travis/build/matthew-brett/dipy/venv/lib/python2.7/site-packages/dipy/viz/tests/test_fvtk.py", line 118, in test_colormaps_matplotlib
    npt.assert_array_almost_equal(rgba1, rgba2, 1)
  File "/home/travis/build/matthew-brett/dipy/venv/lib/python2.7/site-packages/numpy/testing/utils.py", line 979, in assert_array_almost_equal
    precision=decimal)
  File "/home/travis/build/matthew-brett/dipy/venv/lib/python2.7/site-packages/numpy/testing/utils.py", line 796, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 1 decimals
(mismatch 16.675%)
 x: array([[ 1. ,  1. ,  0.6,  1. ],
       [ 0.2,  0.4,  0.7,  1. ],
       [ 0.7,  0.7,  0.8,  1. ],...
 y: array([[ 0.8,  0.8,  0.6,  1. ],
       [ 0.6,  0.7,  0.6,  1. ],
       [ 0.8,  0.7,  0.7,  1. ],...

https://travis-ci.org/matthew-brett/dipy/jobs/208424940

I'm guessing this is because of the new default 'viridis' colormap in matplotlib >= 2.0.

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Mar 7, 2017

Cross ref new testing regime at #1186 .

@arokem

This comment has been minimized.

Member

arokem commented Mar 7, 2017

Strangely enough, this is happening with the "Accent" color map. Looks like that color-map might have changed in Matplotlib. We might need to change the values we have in:

https://github.com/nipy/dipy/blob/master/dipy/data/files/dipy_colormaps.json

@MrBago : how were those values generated? IIRC, you created that file.

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Mar 7, 2017

The Accent colormap did change, essentially from a continuous to a discrete map - see:
http://matplotlib.org/users/whats_new.html#qualitative-colormaps.

Maybe it's worth deprecating the Accent colormap name in dipy, and renaming or removing?

matthew-brett added a commit that referenced this issue Mar 14, 2017

Merge pull request #1193 from arokem/deprecate-accent
MRG: Deprecate the Accent colormap, in anticipation of changes in MPL 2.0


Addresses #1188
@arokem

This comment has been minimized.

Member

arokem commented Mar 29, 2017

This was resolved in #1193

@arokem arokem closed this Mar 29, 2017

ShreyasFadnavis pushed a commit to ShreyasFadnavis/dipy that referenced this issue Sep 20, 2018

Merge pull request nipy#1193 from arokem/deprecate-accent
MRG: Deprecate the Accent colormap, in anticipation of changes in MPL 2.0


Addresses nipy#1188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment