enthought / chaco

Chaco is a Python package for building interactive and custom 2-D plots.
http://docs.enthought.com/chaco/
Other
292 stars 99 forks source link

A large number of errors observed in the testsuite with the celiagg backend. #785

Closed rahulporuri closed 1 year ago

rahulporuri commented 3 years ago

A number of errors were observed in the testsuite when ETS_TOOLKIT=qt.celiagg, Note that these failures were observed on windows.

======================================================================
ERROR: test_text_plot (chaco.tests.test_plot.PlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\rporuri\.edm\envs\chaco-test\lib\site-packages\chaco\tests\test_plot.py", line 117, in test_text_plot
    gc = PlotGraphicsContext((250, 250))
  File "C:\Users\rporuri\.edm\envs\chaco-test\lib\site-packages\chaco\plot_graphics_context.py", line 42, in __init__
    size_or_ary, *args, **kw
  File "C:\Users\rporuri\.edm\envs\chaco-test\lib\site-packages\kiva\celiagg.py", line 93, in __init__
    buffer = np.zeros(shape, dtype=np.uint8)
TypeError: 'float' object cannot be interpreted as an integer

----------------------------------------------------------------------

The culprit seems to be size_or_ary in the PlotGraphicsContextMixin object.

https://github.com/enthought/chaco/blob/d3b7c374eaeb2b6a4ba194eed5751763f3d9b8d2/chaco/plot_graphics_context.py#L35-L43

rahulporuri commented 3 years ago

Note that forcing scale to int makes the testsuite fail with only one error (instead of the 77 like before)

https://github.com/enthought/chaco/blob/d3b7c374eaeb2b6a4ba194eed5751763f3d9b8d2/chaco/plot_graphics_context.py#L34

======================================================================
FAIL: test_draw_border_simple (chaco.tests.test_border.DrawBorderTestCase)
Borders should have the correct height and width.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\rporuri\.edm\envs\chaco-test\lib\site-packages\chaco\tests\test_border.py", line 52, in test_draw_border_simple
    self.assertRavelEqual(actual, desired)
  File "C:\Users\rporuri\.edm\envs\chaco-test\lib\site-packages\chaco\tests\test_border.py", line 29, in assertRavelEqual
    alltrue(ravel(x) == ravel(y)), "\n%s\n !=\n%s" % (x, y)
AssertionError: False is not true :
[[  0   0   0   0   0   0]
 [  0   0   0   0   0   0]
 [  0   0 255 255   0   0]
 [  0   0 255 255   0   0]
 [  0   0   0   0   0   0]
 [  0   0   0   0   0   0]]
 !=
[[255 255 255 255 255 255]
 [255   0   0   0   0 255]
 [255   0 255 255   0 255]
 [255   0 255 255   0 255]
 [255   0   0   0   0 255]
 [255 255 255 255 255 255]]
corranwebster commented 1 year ago

Fixed by #788 and the remaining failure was fixed by doing an explicit gc.clear() in #891 (see https://github.com/enthought/enable/issues/1047 for the underlying cause, not yet resolved).