Skip to content

Test errors with numpy 1.5 - advice? #3191

Closed

Description

@matthew-brett

I am getting test errors with current matplotlib trunk and numpy 1.5.1. An example is here:

======================================================================
ERROR: test suite for <class 'matplotlib.tests.test_axes.test_hist_stacked_bar'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/plugins/multiprocess.py", line 788, in run
    self.setUp()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/plugins/multiprocess.py", line 770, in setupContext
    super(NoSharedFixtureContextSuite, self).setupContext(context)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/util.py", line 470, in try_run
    return func()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 139, in setup_class
    cls._func()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/tests/test_axes.py", line 1988, in test_hist_stacked_bar
    ax.hist(d, bins=10, histtype='barstacked', align='mid', color=colors, label=labels)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 5479, in hist
    flat = np.ravel(x)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 1097, in ravel
    return asarray(a).ravel(order)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py", line 284, in asarray
    return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence.

See: https://s3.amazonaws.com/archive.travis-ci.org/jobs/29198712/log.txt

This boils down to the following code:

In [5]: x = [[], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]

In [6]: np.array(x)

This raises an error (setting an array element with a sequence) for numpy 1.5.1 but passes for numpy 1.6.0. Should I try and work round this, or should matplotlib update compatibility to numpy 1.6.0 ?

Activity

  1. tacaswell commented on Jul 6, 2014

    @tacaswell
    Member

    My inclination would be to bump our minimum version up to 1.6

  2. efiring commented on Jul 6, 2014

    @efiring
    Member

    Moving to 1.6 (or higher? at least one of the 1.6 bugfix releases?) makes sense to me.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions