[IPython-dev] Default values for widgets

Brian Granger ellisonbg@gmail....
Sat Feb 8 00:56:36 CST 2014


Currently, to get this you have to pass an actual Widget to interact:

interact(f, a=FloatSliderWidget(..., value=10), ...)

Even custom Widgets can be passed this way and they will work with
interact, as long as the Widget has a value attribute.

We decided that we wanted to keep the abbreviations as simple as
possible and just allow people to pass Widgets for the more
complicated usage cases. Part of this is that we are wanting to be as
slow/conservative as possible in introducing complexity to new APIs.
We want to see how this stuff works in practice and gather data from
our users (like this!).

Cheers,

Brian

On Fri, Feb 7, 2014 at 10:27 PM, Stéfan van der Walt <stefan@sun.ac.za> wrote:
> Hi all,
>
> I'm giving a demo of the interactive functionality later today, and I was
> hoping there was a way to specify default parameter values.  E.g., the
> image blurring example in the notebook by default sets the r, g, b values to
> 0.5, instead of to 1 (as provided by the keyword arguments).
>
> The widgets are awesome!
>
> Cheers
> Stéfan
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com


More information about the IPython-dev mailing list