-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When calling setRange(np.nan, np.nan) on different superqt slider widgets, the errors vary inconsistently depending on the slider type. While I understand that using NaN is not valid input, I can avoid setting NaN in practice, but I thought this might be a design bug, so I wanted to report it just in case.
Some sliders crash with a RecursionError/OverflowError, some raise a ValueError, and others accept the values silently but become non-functional.
To Reproduce
Run the following code snippet, and replace the slider type on line 9 to test various sliders.
import numpy as np
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QApplication
from superqt.sliders import *
app = QApplication([])
# Change this line to test other sliders
slider = QLabeledDoubleRangeSlider()
slider.setOrientation(Qt.Orientation.Horizontal)
slider.setRange(np.nan, np.nan)
slider.show()
app.exec_()Behavior summary for different sliders
Expected behavior
- Maybe a clear and early error (like
ValueError) when passing NaN. - I think there shouldn't be infinite recursion or crashes deep in enum or label handling.
Desktop (please complete the following information):
- OS: Win10
- Qt Backend: Pyside6==6.8.2.1,Superqt==0.7.3
- Python version: 3.11.9 64-bits
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working






