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

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

Closed
rahulporuri opened this issue Jun 15, 2021 · 2 comments

Comments

@rahulporuri
Copy link
Contributor

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.

if type(size_or_ary) in (list, tuple) and len(size_or_ary) == 2:
size_or_ary = (
size_or_ary[0] * scale + 1,
size_or_ary[1] * scale + 1,
)
super().__init__(
size_or_ary, *args, **kw
)

@rahulporuri
Copy link
Contributor Author

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

scale = kw.pop("dpi", 72.0) / 72.0

======================================================================
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
Copy link
Contributor

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

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

No branches or pull requests

2 participants