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

Rounding of DynamicMap range causes bug #601

Closed
philippjfr opened this issue Apr 11, 2016 · 7 comments
Closed

Rounding of DynamicMap range causes bug #601

philippjfr opened this issue Apr 11, 2016 · 7 comments
Assignees
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@philippjfr
Copy link
Member

Currently due to precision differences in Python vs. Javascript we round values to 10 decimal places. This ensures that the values will match between Python and Javascript, however rounding can result in rounding down or up, which can cause problems. When the upper limit of a dimension is rounded up for example, the rounded value will be outside the limit defined by the dimension range. When moving the slider to the maximum position it will therefore request a frame from Python which falls outside of its defined range and will raise an exception. We should ensure that the rounded values sent to JS are within the original range defined on the dimension.

@philippjfr philippjfr added this to the v1.6.0 milestone Apr 29, 2016
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Apr 29, 2016
@philippjfr philippjfr modified the milestones: v1.5.1, v1.6.0 Jul 1, 2016
@jlstevens jlstevens removed this from the v1.5.1 milestone Jul 17, 2016
@philippjfr philippjfr added this to the v1.6.2 milestone Jul 29, 2016
@jlstevens jlstevens modified the milestones: v1.7.0, v1.6.2 Aug 25, 2016
@basnijholt
Copy link
Contributor

I am encountering this bug now. It took me a while to figure out it was not because I was doing something stupid.

Any recommended workarounds?

@philippjfr
Copy link
Member Author

No I don't know of any workarounds, but this is a high priority issue and I will try to have it fixed asap.

@philippjfr philippjfr self-assigned this Oct 20, 2016
@jlstevens
Copy link
Contributor

I imagine this will be an issue if you have something like range=(0, np.pi) and after rounding the value goes up, outside that range? If so, I think the solution is to use one function to consistently keep the Python and JS values matching while staying within range. In other words, this issue is annoying but it also doesn't sound like it should be too hard to solve.

@philippjfr
Copy link
Member Author

@basnijholt Could you confirm the bug is fixed for you?

@basnijholt
Copy link
Contributor

Sorry, I didn't commit the nonworking code, so it's not easy for me to check.

If you like I'll try to reproduce on Monday :)

@philippjfr
Copy link
Member Author

I'll close, please reraise the issue if needed.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

3 participants