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

Warnings in Python 3.8 test_image_plot #855

Closed
corranwebster opened this issue Jan 24, 2023 · 0 comments · Fixed by #856
Closed

Warnings in Python 3.8 test_image_plot #855

corranwebster opened this issue Jan 24, 2023 · 0 comments · Fixed by #856

Comments

@corranwebster
Copy link
Contributor

corranwebster commented Jan 24, 2023

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

@corranwebster corranwebster changed the title Warnings in Python 3.8 Test Runs Warnings in Python 3.8 test_image_plot Jan 24, 2023
corranwebster added a commit that referenced this issue Jan 24, 2023
corranwebster added a commit that referenced this issue Jan 24, 2023
corranwebster added a commit that referenced this issue Jan 24, 2023
corranwebster added a commit that referenced this issue Jan 24, 2023
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 a pull request may close this issue.

1 participant