-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
In magicgui 0.6.0 setting up a min
value different from 0.
for the FloatSlider
causes two bugs in the widget.
- The default value shown is wrong. (100000, for default=1, and min=0.1)
- When moving the slider the widget crash
Traceback (most recent call last):
File ".../python3.10/site-packages/magicgui/backends/_qtpy/widgets.py", line 640, in _on_readout_change
self._qwidget.setValue(self._pre_set_hook(self._readout_widget.value()))
OverflowError: argument 1 overflowed: value must be in the range -2147483648 to 2147483647
[1] 12542 IOT instruction (core dumped) python test.py
Some more details:
- The error does not affect the function call. If I run the widget in the example below, I get the correct value 1.
- if I set
min=0.
the widget works normally. - Typing a new value next to the slider causes the same
Traceback
as above.
To Reproduce
from magicgui import magicgui
@magicgui(call_button='Run',
sigma={'label': 'Sigma',
'widget_type': 'FloatSlider',
'max': 5.0,
'min': 0.1})
def widget_test(sigma: float = 1.0) -> None:
print(sigma)
widget_test.show(run=True)
Environment (please complete the following information):
- OS: linux, fedora 35
- backend: Qt: 5.12.9, PyQt5: 5.12.3
- magicgui version 0.6.0
- python: 3.10
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working