[IPython-dev] status of ipnbdoctest.py

Alistair Miles alimanfoo at googlemail.com
Tue Dec 23 06:06:53 EST 2014


Just to say I'd also find this very useful. Dealing with random numbers can
be worked around by setting the seed at the top of any notebooks you know
you want to use as doc tests. Matplotlib plots would need some special
handling as I believe the figure object ID ends up in the notebook output
and this obviously changes each run. I've seen people work around this by
stripping out object IDs before comparison, don't know what the best
general solution would be but would be very useful for testing libraries
for making plots.

Cheers,
Alistair

On Friday, 19 December 2014, Zoltán Vörös <zvoros at gmail.com> wrote:

>
> On 12/19/2014 10:21 AM, Nathan Goldbaum wrote:
> > You can use runipy to script notebook evaluation:
> >
> > https://github.com/paulgb/runipy
> >
> > I don't think you can verify that the output isn't changing, but you
> > can at least check that cells aren't raising exceptions and view a
> > converted version of the evaluated notebook.  I think adding
> > functionality to verify that cell output isn't changing would be a
> > neat addition to runipy.
> >
> But there are cases, when the output changes, even if you run the same
> piece of code. Two examples that come to my mind are cells that involve
> the time/date in some way, and cells that operate on random numbers. It
> might also happen that some underlying data file that is plotted is
> modified between two executions. It might be really tricky to check for
> these cases.
>
> Cheers,
> Zoltán
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org <javascript:;>
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>


-- 
Alistair Miles
Head of Epidemiological Informatics
Centre for Genomics and Global Health <http://cggh.org>
The Wellcome Trust Centre for Human Genetics
Roosevelt Drive
Oxford
OX3 7BN
United Kingdom
Web: http://purl.org/net/aliman
Email: alimanfoo at gmail.com
Tel: +44 (0)1865 287721
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141223/986a6589/attachment.html>


More information about the IPython-dev mailing list