-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
Panel requires bounds to be set #33
Comments
When there are no bounds or softbounds, what should happen is to get an editable widget. That's because the toolkit has no way of knowing what the left and right edge of the slider should correspond to. We could make a convention for that case, e.g. to set the lower bound to 1/10th of the default value (or 10x the default value if negative) and the higher bound to 10X the default value (or 1/10th the default value if negative), but to me that seems like just covering up the fact that we really don't know an appropriate range to show, and people won't realize that it's covering an inappropriate range. So we could do that, but my vote is for simply adding some meaningful guess at the softbounds for the cases when there are no hard bounds. Even a bad guess at a suitable softbounds by a human is still going to be more appropriate than anything that could be done automatically. Having the value not be editable is a bug, though -- the value should always be editable for a non-constant parameter. |
I don't think there is no way for us to make a meaningful guess without first knowing the ballpark. If we had a set guess that was outside of the specified default, that would throw an error. I think it will have to be tied to the default and would need to follow something like what you specified here:
Although different widgets will need slight variances of this (float vs Int vs Number). |
There shouldn't be an error in that case; that's what makes softbounds soft. That said, I think Bokeh needs extending before bounds will truly be soft -- at least the last I checked, softbounds are soft for Param but not at the widget level, where there is no way to set the value outside the bounds (even if the hard bounds do allow it). |
(They were truly soft for our first GUI toolkit, ParamTk years ago, where they just determined the starting bounds, but people could type in other values that were within the hard bounds and the widget range would adjust. I would like Bokeh to behave that way too, but I think it would take a bit of work.) |
I think the issue with soft bounds is orthogonal to the issue of not defining any bounds. As you both pointed out only constant parameters should be uneditable. Should we repurpose this issue to address soft bounds or should I close it once I've fixed the uneditable bug? |
I think we need to address when a param.Integer or param.Number has only one or no bounds. We currently represent the parameter as case A: a slider with value string. It would be nice if the value was a editable field to allow quick assignment (case B). The slider and edit field would share bounds so a invalid entry would be reset to the nearest bound. Case C shows a compact version of Case B. I would expect the appropriate arrow button to be disabled if the value is at a bound. If only one bound or no bounds are provided then Case C or Case D, where the field is unrestricted, could apply. |
That's basically how our first, pre-web, version of this system worked -- the softbounds was truly soft, the number was editable, it could be set to any value compatible with any hard bounds, and the soft bounds (slider range) updated when a value was put in that was out of the soft bounds but inside the hard bounds. I think that's how it should work, but I don't know what's involved in making that happen. |
I will close this one because
import param
import panel as pn
class TestClass(param.Parameterized):
integer_size = param.Integer(default=10)
float_size = param.Number(default=10.0)
test_instance=TestClass()
pn.Param(test_instance).servable() |
As discussed at our meeting...
minimum_size = param.Integer(default=10)
Will produce an un-editable widget (just some text on the screen). This also happens with
param.Number
. I believe it has something to do with None bounds.The text was updated successfully, but these errors were encountered: