[IPython-dev] notebook questions

Chris Kees cekees at gmail.com
Fri Sep 16 23:08:32 EDT 2011

On Fri, Sep 16, 2011 at 4:14 PM, MinRK <benjaminrk at gmail.com> wrote:
> On Fri, Sep 16, 2011 at 13:37, Chris Kees <cekees at gmail.com> wrote:
>> Hi,
>> I updated my source on the notebook after I read Fernando's post. Nice
>> work! Couple of questions:
>> Is there a way to use reST in the text boxes? It seems like it sort of
>> works but doesn't get the ::
> No, it uses markdown, which is largely similar, if simpler, and much better
> suited for
> use in a browser.  Indent code blocks by four spaces, and it should
> behave nicely.  Or use `<pre>` tags if you just want it monospaced and not
> highlighted.

I noticed that github allows you to choose between several different
languages for wiki input so I thought you might have something like
that in mind.  I've been using reST for docstrings, sphinx docs, and
github so I selfishly would prefer not to have to learn another
simplified markup language.

>> If I put the notebook safely inside our firewall, would it be
>> reasonable to just let 5-10 people use the same server or do you
>> foresee problems down the road?
> This should be fine, as long as it is acceptable for the 5-10 people to be
> running code as the user that launched the server.  Anyone with access to
> the server can run arbitrary code on the host as this user.  If this is
> acceptable, there should be no problem.  One thing to be careful of is
> simultaneously working with a single notebook: You can both be working with
> the same file, but saving is destructive.  So if two people open a notebook,
> both edit it, and both save it, the later save will clobber the first.

I could set up a special user or virtual machine like is done for sage
servers, and then we could just use a convention that your always save
worksheets in notebooks ending in your initials. One flaw in that plan
is that the current notebook doesn't appear to have a "duplicate" or
"save as" capability, but I'm guessing that would be very easy to add.
 I like the integrated version control idea that Anne Archibald
mentioned in her blog.

>> I've set up a sage server partly for
>> that purpose, but having the ipython notebook available could have
>> some advantages. For example, we're running a computational mechanics
>> seminar where it would be nice to share some simple mpi programs, say
>> in the 8-16 processor range. I don't think we can do that in sage yet,
>> right?
>> In the docs, it talks about the python roundtrip not being guaranteed.
>> What about a sage round trip capability for the notebooks?
> I don't know about the Sage notebook's file formats, but it is unlikely.
>  That doesn't mean that it won't work at all, or even well, but lossless
> roundtrip is generally not feasible between file formats with different
> capabilities.

I understand about the perfect lossless roundtrip being impossible in
general. I'd be happy with a convert script that goes back and forth
with warnings or comments (sort of like a failed merge). As long as
the python part works and most of the text makes it on the round trip
it seems valuable to me.  One can invest quite a bit of effort into
these notebooks, and I like the idea of being able to convert them to
high quality python code or sage with minimal effort.

>> What's the latest recommendation for interactive 3D graphics in the
>> notebook, or what direction should I investigate? Probably the most
>> straightforward route for me would be to take our existing vtk
>> representations that we use with Qt and follow the notebook example on
>> the display protocol.  Also, BTW, is there a PySide qt gui example
>> somewhere?
> The IPython notebook currently has no mechanism for interactive graphics.
> All the usual interactive tools should work if you are running the notebook
> server *locally*, as their windows will pop up as usual.  You can publish
> static HTML, SVG, PNG, or txt representations of objects, but not dynamic
> (unless you write the dynamic part into the HTML/JS output).

OK, that gives a path forward.  Most of our graphics is done in vtk so
I asked the paraview list whether the JS support from the ParaViewWeb
project is available from python yet

>> Thanks,
>> Chris
>> _______________________________________________
>> 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