yposmax and yposmin do not work when data is only negative/positive #21

Closed
opened 2026-07-04 12:34:21 +00:00 by markusro · 0 comments
Owner

If data is negative the function errors and does not display anything:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/damaris/gui/DamarisGUI.py", line 2555, in datapool_idle_listener
self.update_display( )
File "/usr/lib/python3/dist-packages/damaris/gui/DamarisGUI.py", line 2935, in update_display
yminpos = in_result.get_yminpos()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/damaris/data/Drawable.py", line 168, in get_yminpos
ymins.append(ys[mask].min())
^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/numpy/core/_methods.py", line 45, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: zero-size array to reduction operation minimum which has no identity

The problem is that yposmin etc. is not needed for linear axyes, moving calls to the log axis clauses should fix this. If data is negative it can not be plotted anyway!

If data is negative the function errors and does not display anything: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/damaris/gui/DamarisGUI.py", line 2555, in datapool_idle_listener self.update_display( ) File "/usr/lib/python3/dist-packages/damaris/gui/DamarisGUI.py", line 2935, in update_display yminpos = in_result.get_yminpos() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/damaris/data/Drawable.py", line 168, in get_yminpos ymins.append(ys[mask].min()) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/numpy/core/_methods.py", line 45, in _amin return umr_minimum(a, axis, None, out, keepdims, initial, where) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: zero-size array to reduction operation minimum which has no identity The problem is that yposmin etc. is not needed for linear axyes, moving calls to the log axis clauses should fix this. If data is negative it can not be plotted anyway!
markusro self-assigned this 2026-07-04 12:34:21 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IPKM/python3-damaris#21