[Numpy-discussion] Doctest items

Alan McIntyre alan.mcintyre@gmail....
Wed Jul 2 17:10:27 CDT 2008


On Wed, Jul 2, 2008 at 5:47 PM, Stéfan van der Walt <stefan@sun.ac.za> wrote:
> How about a slight modification to Fernando's idea: a dummy function that
>
> a) Does nothing if matplotlib is not installed
> b) Otherwise passes through calls to matplotlib, after setting the
> backend to /dev/null.  Any results (lines, figures, etc.) are
> suppressed.

That's doable; it turned out to be easy to explicitly specify the
execution context of the doctests, so we can add in any number of
dummy objects/functions.  In my working NumPy, the only globally
available items are __builtins__ and np; I was going to update all the
doctests that won't run under that context before changing the tester
behavior, though.

At the moment I don't know anything about configuring matplotlib's
backend and all that, but I'm sure it shouldn't be hard to figure out.
 If somebody was to write a first draft of these dummy objects before
I got around to it I wouldn't complain about it, though. ;)

(By the way, I'm not assuming that there's a consensus about the
matplotlib dummy objects, just saying it turns out to be easy to add
if we want to.)


More information about the Numpy-discussion mailing list