eoyilmaz/displaycal-py3

Error opening curves (Tools:show curves): AttributeError: module 'numpy' has no attribute 'sometrue'

worldpoop opened this issue · 4 comments

Describe the bug
Two errors (gui pop-up dialog boxes) when selecting Tools:show curves. First Error:

can only concatenate str (not "NoneType) to str

Followed by Second Error -- unending pop-up repetition until closing curves

module 'numpy' has no attribute 'sometrue'

Traceback (most recent call last):
File "/Users/mau/displaycal-py3/.venv/lib/python3.10/site-packages/DisplayCAL/wxLUTViewer.py", line 2193, in OnMotion
self.UpdatePointLabel(self.client._getXY(event))
File "/Users/mau/displaycal-py3/.venv/lib/python3.10/site-packages/DisplayCAL/wxLUTViewer.py", line 2464, in UpdatePointLabel
self.client.UpdatePointLabel(mDataDict)
File "/Users/mau/displaycal-py3/.venv/lib/python3.10/site-packages/DisplayCAL/wxenhancedplot.py", line 1915, in UpdatePointLabel
if _Numeric.sometrue(
File "/Users/mau/displaycal-py3/.venv/lib/python3.10/site-packages/numpy/init.py", line 410, in getattr
raise AttributeError("module {!r} has no attribute "
DisplayCal3_curves_window_error_OUTPUT.txt

To Reproduce
When running DisplayCal3, select Tools:show curves

Expected behavior
Curves window to open without error "okay boxes" popping up continuously that prevent interaction with the curves window, until the curves window can be closed.

Screenshots
Attached

Versions (please complete the following information):

  • MacOS Sonoma 14.5 x86_64
  • iMacPro (2017)
  • (pip 24.1) Python 3.10.5 (v3.10.5:f377153967, Jun 6 2022, 12:36:10) [Clang 13.0.0 (clang-1300.0.29.30)]
  • ArgyllCMS 3.2.0 (was 2.3.1b)
  • DisplayCAL 3.9.12 2024-06-23T03:41:13Z
    DisplayCal3_curves_window_error_1
    DisplayCal3_curves_window_error_2

@worldpoop
What is the version of Numpy?

I calibrated a new monitor today and encountered this as well. This seems to be a result of an update to numpy 2.0:

sometrue |Use any instead.

https://numpy.org/doc/2.0/numpy_2_0_migration_guide.html

(Also, sometrue was deprecated in numpy 1.25)

I'm not an expert on how to deal with this sort of thing, but maybe a work-around for the time being is to just cap numpy version to less than 2.0 in requirements.txt?

Actually, the only match for sometrue I could find is

if _Numeric.sometrue(

and a couple of instances in the wxpython package. Maybe it's enough just to change sometrue to any in this case?

Actually, the only match for sometrue I could find is

if _Numeric.sometrue(

and a couple of instances in the wxpython package. Maybe it's enough just to change sometrue to any in this case?

And what happens if you change sometrue by any?