[IPython-dev] [sympy] Re: using reST for representing the notebook cells+text

Brian Granger ellisonbg at gmail.com
Wed Feb 24 13:39:09 EST 2010


>> * No one wants to edit XML by hand.
>
> I don't want to write Python code in that tree style by hand, either.

Yes, for the most part, but the argument for reST is that people can
edit it by hand.  Python is closer to that, but I agree that most people
won't probably do that.

> Too many things to get wrong. I don't see anyone editing notebooks
> outside of the notebook apps, honestly. Does anyone edit Mathematica
> notebooks in a text editor? I don't think the success of Mathematica's
> notebook is the file format; it's the notebook GUI itself.
>
>> * The result is not importable in a regular Python shell.
>
> <shrug> So you use a function call instead.

True, that works for getting an in memory rep of the notebook
(parsing).  But the
importability feature of a pure python notebook format has a broader
impact on the design.  This is related
to validation and extensibility.

validation: not all XML files are valid notebook files.  Thus, you
have to validate the XML at some level.  This means 1) either
developing a schema (which is very rigid) or 2) doing the validation
in Python once you parse the XML.  In the case of a pure python
notebook, validation is done by Python itself.  If the notebook can be
exec'd or imported, it is a valid notebook

extensibility: using XML requires specifying the XML schema in a
central location.  That schema is fixed and thus hard to extend.
Using Python allows the notebook format to be extended by simple
subclassing:

class MatplotlibFigureCell(Cell):


Sure, if your notebook uses the MatplotlibCell



> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the IPython-dev mailing list