[IPython-dev] disabling history
MinRK
benjaminrk at gmail.com
Sat Jul 21 00:56:07 EDT 2012
On Fri, Jul 20, 2012 at 10:45 PM, Jason Grout
<jason-sage at creativetrax.com>wrote:
> In our Sage Cell server [1], we'd like to disable the IPython history
> (since it arguably doesn't make much sense there anyway; only a single
> cell is executing, after all, so we don't want the extra disk writes or
> time it takes to deal with a history). However, we need commands
> executed with silent=False because we need to see output, etc.
>
> I can see several ways of doing this (below). Can I get some comments
> about which way is the most IPythonic?
>
> 1. applying a small patch which decouples the silent and store_history
> attributes [2], and then in every kernel execute message set
> store_history to False and silent to False. I don't like this because
> it leaves the history storing in the (potentially untrusted) user's
> hands, and it takes up bandwidth where it really should be a server-wide
> configuration.
>
I think it makes good sense for store_history and silent to be separate
keys in the execute_request.
For that matter, execute_request keys should probably match directly to
args in run_cell, since it really is an RPC message.
>
> 2. Set the history file to ':memory:', like in
> parallel/engine/engine.py. I suppose this doesn't actually eliminate
> the history, but it does eliminate the disk writes, and makes the
> history go away as soon as the process is done, right?
>
Correct - this is the easiest way to do it with no changes - with disk
involvement at all. You can do this one for now, while we get 1. and/or 2.
into IPython itself.
>
> 3. It would be great if I could, instead of (2), just set the history db
> to the DummyDB class in the core/history file. But since sqlite3 exists
> in Sage's python, that looks like it would take a patch somewhere.
>
I think this also might make sense, though there aren't significant
advantages to using DummyDB over regular history with :memory:.
> Comments?
>
> Thanks,
>
> Jason
>
> [1] We just announced our beta of the new cell server, version 2, this
> time fully based on IPython 0.13 (plus some very small patches, like
> part of gh-2051). You can test it out here: aleph2.sagemath.org. We
> use SockJS to do the websocket/fallback connections, and it seems to
> work quite well. We hope to clean up and contribute back our
> ForkingKernelManager and various other classes that you may want
> sometime before the end of the year.
>
Very cool! I look forward to some pull requests.
If the SockJS stuff is clean, we may well want that in IPython itself as
well, because websockets can still be a headache.
-MinRK
>
> [2] https://gist.github.com/3154504
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120720/5aa498e6/attachment.html>
More information about the IPython-dev
mailing list