Thanks to visit codestin.com
Credit goes to github.com

Skip to content

shading tests + numpy 1.6 #3660

Closed
Closed
@tacaswell

Description

@tacaswell

https://travis-ci.org/matplotlib/matplotlib/builds/38268538

After merging #3547 there are failures on 2.6 np1.6

======================================================================
ERROR: test suite for <class 'matplotlib.tests.test_colors.test_light_source_topo_surface'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/plugins/multiprocess.py", line 788, in run
    self.setUp()
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/plugins/multiprocess.py", line 770, in setupContext
    super(NoSharedFixtureContextSuite, self).setupContext(context)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/util.py", line 470, in try_run
    return func()
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/matplotlib-1.5.x-py2.6-linux-x86_64.egg/matplotlib/testing/decorators.py", line 134, in setup_class
    cls._func()
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/matplotlib-1.5.x-py2.6-linux-x86_64.egg/matplotlib/tests/test_colors.py", line 240, in test_light_source_topo_surface
    with np.load(fname) as dem:
AttributeError: 'NpzFile' object has no attribute '__exit__'

======================================================================
ERROR: Compare the current hillshading method against one that should be
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/matplotlib-1.5.x-py2.6-linux-x86_64.egg/matplotlib/tests/test_colors.py", line 387, in test_light_source_hillshading
    h2 = alternative_hillshade(az, elev, z)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/matplotlib-1.5.x-py2.6-linux-x86_64.egg/matplotlib/tests/test_colors.py", line 374, in alternative_hillshade
    normals /= np.linalg.norm(normals, axis=2)[..., None]
TypeError: norm() got an unexpected keyword argument 'axis'

======================================================================
FAIL: Array comparison test for a surface with a masked portion. Ensures that
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/matplotlib-1.5.x-py2.6-linux-x86_64.egg/matplotlib/testing/decorators.py", line 51, in failer
    result = f(*args, **kwargs)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/matplotlib-1.5.x-py2.6-linux-x86_64.egg/matplotlib/tests/test_colors.py", line 359, in test_light_source_masked_shading
    assert_array_almost_equal(rgb, expect, decimal=2)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/numpy/testing/utils.py", line 800, in assert_array_almost_equal
    header=('Arrays are not almost equal to %d decimals' % decimal))
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/numpy/testing/utils.py", line 636, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 2 decimals

(mismatch 37.890625%)
 x: array([[[  8.97730885e-01,   8.97730885e-01,   8.97730885e-01,
           1.00000000e+00],
        [  8.76251006e-01,   8.22968131e-01,   7.89679082e-01,...
 y: array([[[ 1.  ,  1.  ,  1.  ,  1.  ],
        [ 0.95,  0.93,  0.91,  1.  ],
        [ 0.96,  0.93,  0.91,  1.  ],...

----------------------------------------------------------------------
Ran 4705 tests in 172.938s

FAILED (KNOWNFAIL=18, SKIP=7, errors=2, failures=1)

I am a bit confused from looking at these (particularly the first two) why these things broke/ever passed.

cc @jenshnielsen @jkseppan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions