Skip to content
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

Reimplement fix savefig with size and magnification - step 0 [WIP] #346

Closed
wants to merge 7 commits into from

Conversation

kitchoi
Copy link
Contributor

@kitchoi kitchoi commented Apr 21, 2016

Reimplement part of #331
Tests fail as the fix is incomplete. I aim at making a new branch from this one for fixing those new problems, so that we know what was attempted and what does not work. This issue is complicated.

Running integratedtests/mayavi/test_mlab_savefig.py against master leads to the following errors on both Ubuntu 12 and OSX 10.11

OSX: 10.11, PySide 1.2.2, wxPython 3.0.2.0
Linux: Ubuntu 12, PySide 1.2.2, wxPython 2.8.10.1

Linux/OSX + qt4 + master branch

======================================================================
FAIL: test_savefig_with_size (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and a normal Engine
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 108, in test_savefig_with_size
    self.check_image_size(self.filename, size=(131, 217))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (128, 216) != (131, 217)

First differing element 0:
128
131

- (128, 216)
+ (131, 217)

======================================================================
FAIL: test_savefig_with_size_and_magnification (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and magnification
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 124, in test_savefig_with_size_and_magnification
    self.check_image_no_black_pixel(self.filename)
  File "test_mlab_savefig.py", line 72, in check_image_no_black_pixel
    self.fail(message)
AssertionError: The image has black spots

======================================================================
FAIL: test_savefig_with_size_offscreen (test_mlab_savefig.TestMlabSavefigUnitTest)
Test savefig with given size, normal Engine and offscreen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 156, in test_savefig_with_size_offscreen
    self.check_image_size(self.filename, size=(131, 217))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (128, 216) != (131, 217)

First differing element 0:
128
131

- (128, 216)
+ (131, 217)

----------------------------------------------------------------------
Ran 7 tests in 4.762s

FAILED (failures=3)

Linux/OSX + wx + master branch

======================================================================
FAIL: test_savefig_with_size (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and a normal Engine
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 108, in test_savefig_with_size
    self.check_image_size(self.filename, size=(131, 217))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (540, 234) != (131, 217)

First differing element 0:
540
131

- (540, 234)
+ (131, 217)

======================================================================
FAIL: test_savefig_with_size_and_magnification (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and magnification
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 123, in test_savefig_with_size_and_magnification
    self.check_image_size(self.filename, size=(262, 434))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (180, 78) != (262, 434)

First differing element 0:
180
262

- (180, 78)
+ (262, 434)

======================================================================
FAIL: test_savefig_with_size_and_magnification_offscreen (test_mlab_savefig.TestMlabSavefigUnitTest)
Test savefig with given size, mag, normal Engine and offscreen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 174, in test_savefig_with_size_and_magnification_offscreen
    self.check_image_size(self.filename, size=(262, 434))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (180, 78) != (262, 434)

First differing element 0:
180
262

- (180, 78)
+ (262, 434)

======================================================================
FAIL: test_savefig_with_size_offscreen (test_mlab_savefig.TestMlabSavefigUnitTest)
Test savefig with given size, normal Engine and offscreen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 156, in test_savefig_with_size_offscreen
    self.check_image_size(self.filename, size=(131, 217))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (540, 234) != (131, 217)

First differing element 0:
540
131

- (540, 234)
+ (131, 217)

----------------------------------------------------------------------
Ran 7 tests in 9.848s

FAILED (failures=4)

On Linux + wx, I get addition errors. But they might just be because of the version of wxpython (2.8.10.1)

  File "/home/kit/.jaguar/envs/test-mayavi-2/lib/python2.7/site-packages/vtk/wx/wxVTKRenderWindowInteractor.py", line 381, in OnPaint
    self._Iren.GetRenderWindow().SetSize(self.GetSizeTuple())
AttributeError: 'NoneType' object has no attribute 'SetSize'
FTraceback (most recent call last):
  File "/home/kit/.jaguar/envs/test-mayavi-2/lib/python2.7/site-packages/vtk/wx/wxVTKRenderWindowInteractor.py", line 381, in OnPaint
    self._Iren.GetRenderWindow().SetSize(self.GetSizeTuple())
AttributeError: 'NoneType' object has no attribute 'SetSize'

The following runs integratedtests/mayavi/test_mlab_savefig.py against this branch which unveil new errors:

Linux/OSX + wx + this branch

======================================================================
FAIL: test_savefig_with_size (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and a normal Engine
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 109, in test_savefig_with_size
    self.check_image_no_black_pixel(self.filename)
  File "test_mlab_savefig.py", line 72, in check_image_no_black_pixel
    self.fail(message)
AssertionError: The image has black spots

======================================================================
FAIL: test_savefig_with_size_and_magnification (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and magnification
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 124, in test_savefig_with_size_and_magnification
    self.check_image_no_black_pixel(self.filename)
  File "test_mlab_savefig.py", line 72, in check_image_no_black_pixel
    self.fail(message)
AssertionError: The image has black spots

======================================================================
FAIL: test_savefig_with_size_and_magnification_offscreen (test_mlab_savefig.TestMlabSavefigUnitTest)
Test savefig with given size, mag, normal Engine and offscreen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 174, in test_savefig_with_size_and_magnification_offscreen
    self.check_image_size(self.filename, size=(262, 434))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (180, 78) != (262, 434)

First differing element 0:
180
262

- (180, 78)
+ (262, 434)

======================================================================
FAIL: test_savefig_with_size_offscreen (test_mlab_savefig.TestMlabSavefigUnitTest)
Test savefig with given size, normal Engine and offscreen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 156, in test_savefig_with_size_offscreen
    self.check_image_size(self.filename, size=(131, 217))
  File "test_mlab_savefig.py", line 82, in check_image_size
    self.assertEqual(image.shape[:2][::-1], size)
AssertionError: Tuples differ: (90, 39) != (131, 217)

First differing element 0:
90
131

- (90, 39)
+ (131, 217)

----------------------------------------------------------------------
Ran 7 tests in 2.673s

FAILED (failures=4)

Linux/OSX + qt4 + this branch

======================================================================
FAIL: test_savefig_with_size (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and a normal Engine
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 109, in test_savefig_with_size
    self.check_image_no_black_pixel(self.filename)
  File "test_mlab_savefig.py", line 72, in check_image_no_black_pixel
    self.fail(message)
AssertionError: The image has black spots

======================================================================
FAIL: test_savefig_with_size_and_magnification (test_mlab_savefig.TestMlabSavefigUnitTest)
Test if savefig works with given size and magnification
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mlab_savefig.py", line 124, in test_savefig_with_size_and_magnification
    self.check_image_no_black_pixel(self.filename)
  File "test_mlab_savefig.py", line 72, in check_image_no_black_pixel
    self.fail(message)
AssertionError: The image has black spots

----------------------------------------------------------------------
Ran 7 tests in 2.275s

FAILED (failures=2)

@kitchoi kitchoi changed the title Reimplement fix savefig with size and magnification Reimplement fix savefig with size and magnification [WIP] Apr 21, 2016
@kitchoi kitchoi changed the title Reimplement fix savefig with size and magnification [WIP] Reimplement fix savefig with size and magnification - step 0 [WIP] Jun 2, 2016
@kitchoi
Copy link
Contributor Author

kitchoi commented Oct 5, 2016

too stale, closing.

@kitchoi kitchoi closed this Oct 5, 2016
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.

None yet

1 participant