Problem Description
The following traits deprecation warning is raised in our application that makes use of ImagePlot. This seems to be because a trait defined as a Union(Tuple, List) is being set a list, which traits seems to be coercing into a tuple instead of accepting the list as is.
C:\Users\rporuri\.edm\envs\<env-name>\lib\site-packages\traits\trait_types.py:4245: 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)
|
# Tuple-defined rectangle (x, y, dx, dy) in screen space in which the |
|
# **_cached_image** is to be drawn. |
|
_cached_dest_rect = Union(Tuple, List, transient=True) |
|
self._cached_dest_rect = screen_rect |
where screen_rect is a list, not a tuple.
|
def trim_screen_rect(screen_rect, view_rect, sub_array_size): |
Reproduction Steps:
N/A
OS, Python version: Windows 11, Python 3.8.12+3
Problem Description
The following traits deprecation warning is raised in our application that makes use of
ImagePlot. This seems to be because a trait defined as aUnion(Tuple, List)is being set alist, which traits seems to be coercing into atupleinstead of accepting thelistas is.chaco/chaco/plots/image_plot.py
Lines 85 to 87 in 695f1c0
chaco/chaco/plots/image_plot.py
Line 288 in 695f1c0
where
screen_rectis a list, not a tuple.chaco/chaco/image_utils.py
Line 15 in 695f1c0
Reproduction Steps:
N/A
OS, Python version: Windows 11, Python 3.8.12+3