Using visvis with Reinteract

10 views
Skip to first unread message

Robert Schroll

unread,
Mar 26, 2011, 7:56:02 PM3/26/11
to vis...@googlegroups.com
Hi all,

I thought it was high time to let you all know why I wanted a GTK
backend for visvis. The answer is Reinteract.

Reinteract (http://www.reinteract.org/trac/) is an all-together nifty
way to use Python. It is based on the concept of "worksheets" that mix
code and the output of the code in a single document. The same idea is
used in Mathematica and Sage, but Reinteract takes it a step farther.
When you edit an already-executed statement, Reinteract will "rewind"
the state to be identical [1] to that when the statement was first
executed. This ensures that your worksheet is always in a consistent
state -- if you close it and reopen it, you'll get exactly the same results.

[1] Well, as near as possible. Somethings trip this up, but in practice
it works rather well.

Reinteract allows extensions to embed GTK widgets in the notebook. So
I've written revis (http://rschroll.github.com/revis/), which does just
that for visvis figures. It's a bit rough at the moment, but it does
have basic functionality. Of course, you'll need a recent version of
visvis that has the GTK backend. You probably want to current trunk
version so that modifier keys are correctly detected.

Please let me know if you have questions or comments,
Robert

Almar Klein

unread,
Apr 1, 2011, 8:15:54 AM4/1/11
to vis...@googlegroups.com
Reinteract (http://www.reinteract.org/trac/) is an all-together nifty way to use Python.  It is based on the concept of "worksheets" that mix code and the output of the code in a single document.  The same idea is used in Mathematica and Sage, but Reinteract takes it a step farther. When you edit an already-executed statement, Reinteract will "rewind" the state to be identical [1] to that when the statement was first executed.  This ensures that your worksheet is always in a consistent state -- if you close it and reopen it, you'll get exactly the same results.
 
Sounds interesting.

 
Reinteract allows extensions to embed GTK widgets in the notebook.  So I've written revis (http://rschroll.github.com/revis/), which does just that for visvis figures.  It's a bit rough at the moment, but it does have basic functionality.  

I can't get it to work on Windows since I have no proper GTK here, but will test it later on Linux. I can run Reinteract itself and tried to just import visvis. This produces an error though. "The system cannot find the path specified: 'c:\\Program Files (x86)\\Reinteract\\bin\\visvisResources/*.*'".  Visvis tries to load resources from a directory relative to the __file__ in one of its modules. Is Reinteract doing something magical that this does not work?
 

Of course, you'll need a recent version of visvis that has the GTK backend.  You probably want to current trunk version so that modifier keys are correctly detected.

Given the amount of changes currently applied, I think we should release a new version of visvis sometimes soon. This will help revis-users too.

  Almar




Robert Schroll

unread,
Apr 1, 2011, 2:51:39 PM4/1/11
to vis...@googlegroups.com
On 04/01/2011 08:15 AM, Almar Klein wrote:
> I can't get it to work on Windows since I have no proper GTK here, but will
> test it later on Linux. I can run Reinteract itself and tried to just import
> visvis. This produces an error though. "The system cannot find the path
> specified: 'c:\\Program Files
> (x86)\\Reinteract\\bin\\visvisResources/*.*'". Visvis tries to load
> resources from a directory relative to the __file__ in one of its modules.
> Is Reinteract doing something magical that this does not work?

Reinteract does have custom import handling. But it works for me on
Linux. (I've tried both the current trunk and version 0.5.0; I don't
know which you installed.) I'm a bit worried that you have both forward
and backslashes in the path - it could be that Reinteract is assuming
Unix path separators. But the path looks completely wrong:
visvisResources shouldn't be in Reinteract's files at all. I don't know
how Reinteract could screw that up in an operating-system-dependent way.

I'll futz through the import code of Reinteract and see if I can
understand it.

Thanks for testing,
Robert

Reply all
Reply to author
Forward
0 new messages