[IPython-dev] Fwd: [SciTech] ActivePapers Python edition

Thomas Kluyver takowl at gmail.com
Sun Dec 8 14:40:28 EST 2013


On 8 December 2013 03:16, Konrad Hinsen <konrad.hinsen at fastmail.net> wrote:

> > Yes - the prompt numbers by the cells record the order of execution.
>
> If that's the same information shown in the browser, then it's only
> the number of the last execution that remains available. And that
> means that I cannot reconstruct the history of execution. To make it
> worse, a cell could have been modified and re-executed, so the
> original code is no longer available.
>

That's all the information available in the notebook frontend, but the
kernel records every cell executed, so there's a record of all the code
that has run in the present session. The kernel knows nothing about the
notebook document, so if for instance a cell has been edited since it was
executed, there's no easy way to know which cell that execution represents.
However, you can easily enough tell whether the current notebook has been
run through once with no editing, by comparing the list of code cells to
the history.


>
>  > However, I think that the reproducible case should normally be the
>  > one where the cells are run in order from top to bottom. Running
>  > them out of order is convenient, but to check that a notebook all
>  > works together, it's common to clear all output, reset the kernel,
>  > and run all cells in order.
>
> That's what people should do, but I still need to decide what to do
> when a user runs cells randomly and then wants to save the notebook to
> an ActivePapers backend. Since any result datasets are in a
> non-reproducible state, the options are
>
>   1) Refuse with an error message.
>   2) Re-run the notebook in order before saving.
>   3) Save the notebook, but mark it and all its results as stale.
>      Stale datasets are marked as such and require an update
>      before they can be used in some other computation.
>
> I'll probably go for 3) and see how this works out.


3 sounds like the best option to me: you can save the information, but it
shouldn't be considered as the fixed form for later calculations.
Presumably ActivePapers will be able to re-run the cells in order if it
needs to freshen the results, without the user having to manually open the
notebook and execute the cells.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20131208/2385c235/attachment.html>


More information about the IPython-dev mailing list