Merge lp:~ipython-contrib/ipython/qt-frontend into lp:ipython/0.11

Proposed by Muzgash
Status: Merged
Merged at revision: 1263
Proposed branch: lp:~ipython-contrib/ipython/qt-frontend
Merge into: lp:ipython/0.11
Diff against target: 76 lines (+62/-1)
2 files modified
docs/source/development/index.txt (+1/-1)
docs/source/development/ipython_qt.txt (+61/-0)
To merge this branch: bzr merge lp:~ipython-contrib/ipython/qt-frontend
Reviewer Review Type Date Requested Status
Fernando Perez Approve
Review via email: mp+23594@code.launchpad.net

Description of the change

Documentation added for the requirements of Google Summer of Code event:
Added docs/source/development/ipython_qt.txt

To post a comment you must log in.
1230. By Gerardo <muzgash@Muzpelheim>

fixed :: bug in the code part

1231. By Gerardo <muzgash@Muzpelheim>

Added details in the IPythonQt documentation:
Extended details for each one of the parts of the project
Added a required text for GSoC: "Possible future directions"

Revision history for this message
Fernando Perez (fdo.perez) wrote :

Good job, thanks.

Merging now, so this code will be in for the github transition.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/source/development/index.txt'
2--- docs/source/development/index.txt 2010-01-13 09:49:32 +0000
3+++ docs/source/development/index.txt 2010-04-18 23:42:23 +0000
4@@ -17,4 +17,4 @@
5 magic_blueprint.txt
6 notification_blueprint.txt
7 ipgraph.txt
8-
9+ ipython_qt.txt
10
11=== added file 'docs/source/development/ipython_qt.txt'
12--- docs/source/development/ipython_qt.txt 1970-01-01 00:00:00 +0000
13+++ docs/source/development/ipython_qt.txt 2010-04-18 23:42:23 +0000
14@@ -0,0 +1,61 @@
15+.. _ipython_qt:
16+
17+====================
18+IPython Qt interface
19+====================
20+
21+Abstract
22+------------
23+
24+This is about the implementation of a Qt-based Graphical User Interface (GUI) to execute Python code with an interpreter that runs in a separate process and the two systems (GUI frontend and interpreter kernel) communicating via the ZeroMQ Messaging library. The bulk of the implementation will be done without dependencies on IPython (only on Zmq). Once the key features are ready, IPython-specific features can be added using the IPython codebase.
25+
26+
27+Project details
28+-------------------
29+
30+For a long time there has been demand for a graphical user interface for IPython, and the project already ships Wx-based prototypes thereof. But these run all code in a single process, making them extremely brittle, as a crash of the Python interpreter kills the entire user session. Here I propose to build a Qt-based GUI that will communicate with a separate process for the code execution, so that if the interpreter kernel dies, the frontend can continue to function after restarting a new kernel (and offering the user the option to re-execute all inputs, which the frontend can know).
31+
32+This GUI will allow for the easy editing of multi-line input and the convenient re-editing of previous blocks of input, which can be displayed in a 2-d workspace instead of a line-driven one like today's IPython. This makes it much easier to incrementally build and tune a code, by combining the rapid feedback cycle of IPython with the ability to edit multiline code with good graphical support.
33+
34+
35+2-process model pyzmq base
36+++++++++++++++++++++++++++
37+Since the necessity of a user to keep his data safe, the design is based in a 2-process model that will be achieved with a simple client/server system with `pyzmq <http://www.zeromq.org/bindings:python>`_, so the GUI session do not crash if the the kernel process does. This will be achieved using this test `code <http://github.com/fperez/pyzmq/blob/completer/examples/kernel/kernel.py>`_ and customizing it to the necessities of the GUI such as queue management with discrimination for different frontends connected to the same kernel and tab completion. A piece of drafted code for the kernel (server) should look like this::
38+
39+ def main():
40+ c = zmq.Context(1, 1)
41+ rep_conn = connection % port_base
42+ pub_conn = connection % (port_base+1)
43+ print >>sys.__stdout__, "Starting the kernel..."
44+ print >>sys.__stdout__, "On:",rep_conn, pub_conn
45+ session = Session(username=u'kernel')
46+ reply_socket = c.socket(zmq.XREP)
47+ reply_socket.bind(rep_conn)
48+ pub_socket = c.socket(zmq.PUB)
49+ pub_socket.bind(pub_conn)
50+ stdout = OutStream(session, pub_socket, u'stdout')
51+ stderr = OutStream(session, pub_socket, u'stderr')
52+ sys.stdout = stdout
53+ sys.stderr = stderr
54+ display_hook = DisplayHook(session, pub_socket)
55+ sys.displayhook = display_hook
56+ kernel = Kernel(session, reply_socket, pub_socket)
57+
58+This kernel will use two queues (output and input), the input queue will have the id of the process(frontend) making the request, type(execute, complete, help, etc) and id of the request itself and the string of code to be executed, the output queue will have basically the same information just that the string is the to be displayed. This model is because the kernel needs to maintain control of timeouts when multiple requests are sent and keep them indexed.
59+
60+Qt based GUI
61+++++++++++++
62+Design of the interface is going to be based in cells of code executed on the previous defined kernel. It will also have GUI facilities such toolboxes, tooltips to autocomplete code and function summary, highlighting and autoindentation.
63+It will have the cell kind of multiline edition mode so each block of code can be edited and executed independently, this can be achieved queuing QTextEdit objects (the cell) giving them format so we can discriminate outputs from inputs.
64+One of the main characteristics will be the debug support that will show the requested outputs as the debugger (that will be on a popup widget) "walks" through the code, this design is to be reviewed with the mentor.
65+`This <http://gfif.udea.edu.co/IPythonQt_snapshot.png>`_ is a tentative view of the main window.
66+
67+The GUI will check continuously the output queue from the kernel for new information to handle. This information have to be handled with care since any output will come at anytime and possibly in a different order than requested or maybe not appear at all, this could be possible due to a variety of reasons(for example tab completion request while the kernel is busy processing another frontend's request). This is, if the kernel is busy it won't be possible to fulfill the request for a while so the GUI will be prepared to abandon waiting for the reply if the user moves on or a certain timeout expires.
68+
69+
70+POSSIBLE FUTURE DIRECTIONS
71+---------------------------
72+
73+The near future will bring the feature of saving and loading sessions, also importing and exporting to different formats like rst, html, pdf and python/ipython code, a discussion about this is taking place in the ipython-dev mailing list. Also the interaction with a remote kernel and distributed computation which is an IPython's project already in development.
74+
75+The idea of a mathematica-like help widget (i.e. there will be parts of it that will execute as a native session of IPythonQt) is still to be discussed in the development mailing list but it's definitively a great idea.
76\ No newline at end of file

Subscribers

People subscribed via source and target branches