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

traits.trait_errors.TraitError: Cannot set the undefined 'format' attribute of a 'RangeEditor' object. when running chaco/chaco/examples/demo/nonlinear_color_mapping.py #888

Closed
homosapien-lcy opened this issue May 2, 2023 · 1 comment · Fixed by #892

Comments

@homosapien-lcy
Copy link
Contributor

homosapien-lcy commented May 2, 2023

Problem Description
When running example chaco/chaco/examples/demo/nonlinear_color_mapping.py, a traits.trait_errors.TraitError: Cannot set the undefined 'format' attribute of a 'RangeEditor' object. is raised

Reproduction Steps:

python chaco/chaco/examples/demo/nonlinear_color_mapping.py

Link:
https://github.com/enthought/chaco/blob/main/chaco/examples/demo/nonlinear_color_mapping.py

Full Stacktrace:

(py311) (base) cyliu@aus552cyliu Documents % python3.11 3.11_test/chaco/chaco/examples/demo/qt_example.py
2023-05-02 17:34:47.993 Python[5398:120343] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/2z/kylzj9s92y71cxscmljmpqrh0000gt/T/org.python.python.savedState
(py311) (base) cyliu@aus552cyliu Documents % python3.11 3.11_test/chaco/chaco/examples/demo/nonlinear_color_mapping.py 
Traceback (most recent call last):
  File "/Users/cyliu/Documents/3.11_test/chaco/chaco/examples/demo/nonlinear_color_mapping.py", line 169, in <module>
    class DataGridView(HasTraits):
  File "/Users/cyliu/Documents/3.11_test/chaco/chaco/examples/demo/nonlinear_color_mapping.py", line 198, in DataGridView
    editor=RangeEditor(low=0.1, high=3.0, format="%4.2f"),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cyliu/Documents/3.11_test/traitsui/traitsui/editor_factory.py", line 81, in __init__
    HasPrivateTraits.__init__(self, **traits)
traits.trait_errors.TraitError: Cannot set the undefined 'format' attribute of a 'RangeEditor' object.

OS, Python version: [MacOS, python3.11]

Package            Version     Editable project location
------------------ ----------- -----------------------------------------
apptools           5.2.0
attrdict           2.0.1
attrdict3          2.0.2
blosc2             2.0.0
celiagg            2.1.3
certifi            2022.12.7
chaco              5.1.0       /Users/cyliu/Documents/3.11_test/chaco
charset-normalizer 3.1.0
configobj          5.0.8
cPython            0.0.6
Cython             0.29.34
dnspython          2.3.0
enable             5.4.0.dev31 /Users/cyliu/Documents/3.11_test/enable
fonttools          4.39.2
h5py               3.8.0
idna               3.4
joblib             1.2.0
kiwisolver         1.4.4
msgpack            1.0.5
numexpr            2.8.4
numpy              1.24.2
packaging          23.1
pandas             1.5.3
Pillow             9.4.0
pip                23.1
py-cpuinfo         9.0.0
PyAudio            0.2.13
pyface             8.0.0       /Users/cyliu/Documents/3.11_test/pyface
pygarrayimage      1.0
pyglet             2.0.5       /Users/cyliu/Documents/3.11_test/pyglet
Pygments           2.14.0
pymongo            4.3.3
pyparsing          3.0.9
PySide6            6.4.3
PySide6-Addons     6.4.3
PySide6-Essentials 6.4.3
python-dateutil    2.8.2
pythonw            3.0.3
pytz               2023.2
reportlab          3.6.12
requests           2.28.2
scikit-learn       1.2.2
scipy              1.10.1
setuptools         65.6.3
shiboken6          6.4.3
six                1.16.0
tables             3.8.0
threadpoolctl      3.1.0
traits             6.4.1
traitsui           8.0.0.dev0  /Users/cyliu/Documents/3.11_test/traitsui
urllib3            1.26.15
wxPython           4.2.0
@homosapien-lcy
Copy link
Contributor Author

It seems that it's an unaddressed depreciation mentioned here: https://github.com/enthought/traitsui/blob/main/traitsui/editors/range_editor.py#L195

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