[SciPy-dev] Summer Doc Marathon status report and request for more writers

Stéfan van der Walt stefan@sun.ac...
Tue Jul 8 16:00:06 CDT 2008


2008/7/8 nicky van foreest <vanforeest@gmail.com>:
> I just took up the task of reviewing some entries. In the entry on the
> arccos I found an example that runs nearly out of the box. However,
> the example states to import matplotlib, while the demos on matplotlib
> use "from pylab import *". Is there any policy on what would be the
> "most" correct way to import libraries. Besides this, should examples
> always include the string "import numpy as np", or is this implicit?
> The problem is that I now had to complete the example with this
> import.  I would prefer to use examples in the documentation that
> works completely foolproof, hence, include the string "import numpy as
> np" wherever appropriate. What is the policy on this?

>From http://projects.scipy.org/scipy/numpy/wiki/CodingStyleGuidelines#docstring-standard:

"""
The examples may assume that import numpy as np is executed before the
example code in numpy, and import scipy as sp in scipy. Additional
examples may make use of matplotlib for plotting, but should import it
explicitly, e.g., import matplotlib.pyplot as plt.
"""

Regards
Stéfan


More information about the Scipy-dev mailing list