<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 2:57 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hi Darren,<br></div><div class=""><div class="gmail_extra"><br><div class="gmail_quote">
On 27 February 2014 11:37, Darren Dale <span dir="ltr"><<a href="mailto:dsdale24@gmail.com" target="_blank">dsdale24@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">However, I have a question about portions of the analysis that would require user interaction via a widget. Suppose I start from an ipynb template which includes a slider that defaults to 25. My particular dataset requires the slider to be set to 30. Is it possible for an ipynb widget to save its most recent value as the new default value for the next time the notebook is run? This would be a game-changer for developing user interfaces for scientific applications.</blockquote>


</div><br></div></div><div class="gmail_extra">We haven't yet worked out how to save widgets, so they disappear entirely when you reload a notebook. We'll get to that for 3.0, and I imagine then that the latest value of a slider will be saved with the notebook.<br>


<br></div><div class="gmail_extra">However, if you re-run the cell, I think it will (and should) always return the default to what the code specifies. I think it's important that running code has a predictable result. But I don't think this is a problem: if you want the default to be 30, just set it to 30 in your code.</div>
</div></blockquote><div><br></div><div>I agree about the importance of re-running code and getting a predictable result. If I hand an ipynb to a student, they return with a result, and I want to know how they got that result, it want to open the notebook, see precisely how the widgets were set to yield the result, and rerun all the cells in the notebook to reproduce the result. I don't want the widgets to fall back to the defaults, because then I have to interact with every widget all over again to reproduce the result. Perhaps a global setting at the top of the notebook to enable/disable widget value persistence would be acceptable?</div>
</div></div></div>