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

Matthias BUSSONNIER bussonniermatthias at gmail.com
Mon Dec 9 09:59:33 EST 2013


Le 9 déc. 2013 à 14:28, Konrad Hinsen a écrit :

> Thomas Kluyver writes:
> 
>> 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.
> 
> That looks good enough for my purposes. Could you give me a pointer
> to how I can access the kernel's history information for doing
> such a comparison?

the history sqlite file (.ipython/profile_default/history.sqlite) 
contains lots of info like raw input entered by user.

you are probably interessed in session and history and join the two:

sqlite> .schema history
CREATE TABLE history
                (session integer, line integer, source text, source_raw text,
                PRIMARY KEY (session, line));

sqlite> .schema sessions
CREATE TABLE sessions (session integer
                        primary key autoincrement, start timestamp,
                        end timestamp, num_cmds integer, remark text);

I see here that only sessions have timestamp, should we add timestamp to history ?
--
M


> 
>>    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.
> 
> Yes. Well, at least that's my intention, it isn't implemented yet for
> notebooks. With today's ActivePapers implementation, the command
> "aptool update" will re-run all calclets whose code or output is
> marked as "stale" (no longer up to date) or "dummy" (intentionally
> removed to reduce the file size).
> 
> Konrad
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev




More information about the IPython-dev mailing list