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

small decimals not working in Qt Backend #177

Closed
tlambert03 opened this issue Mar 11, 2021 · 0 comments · Fixed by #178
Closed

small decimals not working in Qt Backend #177

tlambert03 opened this issue Mar 11, 2021 · 0 comments · Fixed by #178
Labels
bug Something isn't working

Comments

@tlambert03
Copy link
Member

tlambert03 commented Mar 11, 2021

by default, QDoubleSpinBox has a precision of 2 decimals... we need to change that if a very small value or step size has been entered.

(temporary workaround):

def fix_float(widget):
    # have to use the Qt API for now... and reset the value
    widget.Learning_rate.native.setDecimals(4)
    widget.Learning_rate.value = 0.0001

@magic_factory(call_button=True, rate={'step': 0.0001}, widget_init=fix_float)
def train(rate: float=0.0001): ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant