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

Warnings in Python 3.8 `test_image_plot` #855

Closed corranwebster closed 1 year ago

corranwebster commented 1 year ago

Problem Description

A number of warnings are generated during test runs under Python 3.8.

A list being set on a Tuple trait:

test_horizontal_bottom_left (chaco.plots.tests.test_image_plot.TestResultImage) ... /home/runner/.edm/envs/chaco-test-3.8-pyside6/lib/python3.8/site-packages/traits/trait_types.py:4244: DeprecationWarning: In the future, lists will no longer be accepted by the Tuple trait type. Lists should be converted to tuples prior to validation.
  return trait_type_instance.validate(obj, name, value)
ok

A bad division somewhere:

test_resize_to_zero (chaco.plots.tests.test_image_plot.TestResultImage) ... /home/runner/.edm/envs/chaco-test-3.8-pyside6/lib/python3.8/site-packages/chaco/axis.py:710: RuntimeWarning: invalid value encountered in true_divide
  self._axis_pixel_vector = self._axis_vector / sqrt(
ok

A deprecated NumPy function:

/home/runner/.edm/envs/chaco-test-3.8-pyside6/lib/python3.8/site-packages/chaco/plots/tests/test_image_plot.py:40: DeprecationWarning: This function is deprecated. Please call randint(0, 255 + 1) instead
  IMAGE = np.random.random_integers(0, 255, size=([10](https://github.com/enthought/chaco/actions/runs/3994687826/jobs/6852683234#step:9:11)0, 200)).astype(np.uint8)

There is a similar warning in test_data_label_tool:

/home/runner/.edm/envs/chaco-test-3.8-pyside6/lib/python3.8/site-packages/chaco/tools/tests/test_data_label_tool.py:13: DeprecationWarning: This function is deprecated. Please call randint(0, 255 + 1) instead
  IMAGE = np.random.random_integers(0, 255, size=(100, 200)).astype(np.uint8)

It is possible that these warnings are more widespread but we are only seeing the first occurrence.

Reproduction Steps:

Run the tests using edmtool with Python 3.8

Expected behavior:

No Warnings.

OS, Python version: All, Python 3.8