-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Interact should accept tuple of min, max, and value as input #333
Comments
Definitely. PR? |
The problem is that a tuple of three currently means (min, max, step) so either the value could be the 4th item, or the meaning of a 3 tuple would change. |
It would need to be the 4th item, then. |
For clarity - it would work just as well for my use case if there were a way to set function defaults from a dict. This works as expected: @interact(year=(2017, 2018), month=(1, 12), day=(1, 31))
def day(year=2018, month=1, day=1):
return cat.anaconda_package_data_by_day(**locals()) But I need to set the interact kwargs with ranges = {}
defaults = {}
for up in cat.anaconda_package_data_by_day._user_parameters:
ranges[up.name] = (up.min, up.max)
defaults[up.name] = up.default
print(ranges, defaults)
The issue is that those default values are in a dict and I don't know how to extract them into the function definition. |
At the moment interact only supports passing value OR (min, max). It would be very helpful to be able to pass all three. For context - this came up in the context of making widgets from intake user parameters which have default values in addition to min, and max.
The text was updated successfully, but these errors were encountered: