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

Skip to content

Matplotlib 1.3.0rc2 test errors on win-amd64-py2.7 #2106

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

Merged
merged 3 commits into from
Jul 2, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Jul 2, 2013

Matplotlib 1.3.0rc2 fails the following tests (besides #2086) on win-amd64-py2.7. Numpy is version 1.7.1.

======================================================================
ERROR: matplotlib.tests.test_simplification.test_start_with_moveto.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "X:\Python27-x64\lib\site-packages\matplotlib\testing\decorators.py", line 73, in test
    self._func()
  File "X:\Python27-x64\lib\site-packages\matplotlib\tests\test_simplification.py", line 156, in test_start_with_moveto
    segs = list(segs)
  File "X:\Python27-x64\lib\site-packages\matplotlib\path.py", line 410, in iter_segments
    while i < len_vertices:
TypeError: unbound method __array__() must be called with IdentityTransform instance as first argument (got dtype instance instead)

======================================================================
FAIL: matplotlib.tests.test_contour.test_contour_shape_mismatch_4.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "X:\Python27-x64\lib\site-packages\matplotlib\testing\decorators.py", line 73, in test
    self._func()
  File "X:\Python27-x64\lib\site-packages\matplotlib\tests\test_contour.py", line 101, in test_contour_shape_mismatch_4
    'found (9, 9) instead of (9, 10).'
AssertionError:
-------------------- >> begin captured stdout << ---------------------
Shape of x does not match that of z: found (9L, 9L) instead of (9L, 10L).

--------------------- >> end captured stdout << ----------------------

@dmcdougall
Copy link
Member

@cgohlke Does this still fail on rc4?

@cgohlke
Copy link
Contributor Author

cgohlke commented Jun 23, 2013

It still fails. Only #2086 was fixed.
The test_contour failure is harmless. Not sure it's worth fixing the test or marking it knownfail on win-amd64-py2.x.

@dmcdougall
Copy link
Member

I don't understand that error message. I had a cursory look at the test and this is the function call:

segs = path.iter_segments(transforms.IdentityTransform, clip=(0.0, 0.0, 100.0, 100.0))

The first argument is indeed of the right type, so this is rather confusing. As for it failing on the while loop, I have no idea what's going on there. Both i and len_vertices are just integers.

@cgohlke
Copy link
Contributor Author

cgohlke commented Jul 1, 2013

Could it be an incorrectly handled exception in the C++ extension? If I add try: raise except: pass statements after the call to _path.cleanup_path, before the line while i < len_vertices, the test passes.

@cgohlke
Copy link
Contributor Author

cgohlke commented Jul 1, 2013

Maybe I am missing something, but according to the docstring the transform parameter to path.iter_segments should be a instance of matplotlib.transforms.Transform while the test passes the class. In fact, using segs = path.iter_segments(transforms.IdentityTransform(), clip=(0.0, 0.0, 100.0, 100.0)) fixes the test failure. But how/why did passing the class work on platforms other than win-amd-py2.x?

@dmcdougall
Copy link
Member

Oh that's a good catch!

I have no idea why that doesn't work on windows. I feel like if that failed on windows it should fail everywhere.

@mdboom
Copy link
Member

mdboom commented Jul 1, 2013

@cgohlke: That fix certainly seems reasonable, and logically it definitely should be an instance as you proposed. When the transform is ultimately passed to C++, it tries to convert it to a transform, and failing that falls back to the identity transform... so one would expect to see the same behavior even though the input is nonsense. I haven't looked, but I suspect you're right that it's in the handling of the exception (or not) that the difference between Windows and other platforms is revealed. I've marked this as blocker and will endeavor to fix the underlying problem as well as the obvious one (fixing the test) before the next release candidate.

@mdboom
Copy link
Member

mdboom commented Jul 2, 2013

I have what I hope are fixes for all of the above. I'm not clear on why it wasn't failing on Linux/OS-X, but there was definitely an uncleared Python exception sticking around. @cgohlke: Can you confirm this fixes these tests?

@cgohlke
Copy link
Contributor Author

cgohlke commented Jul 2, 2013

I can confirm that the change to agg_py_transforms.cpp fixes the TypeError.

@cgohlke
Copy link
Contributor Author

cgohlke commented Jul 2, 2013

The changes to test_contour.py also seem to work although I get some seemingly unrelated new ImageComparisonFailure. I'll postpone full testing to the new release candidate...

mdboom added a commit that referenced this pull request Jul 2, 2013
Matplotlib 1.3.0rc2 test errors on win-amd64-py2.7
@mdboom mdboom merged commit 15c7b9b into matplotlib:v1.3.x Jul 2, 2013
@mdboom mdboom deleted the identitytransform-bugfix branch August 7, 2014 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants