[SciPy-Dev] import scipy convention in docstring Examples

Warren Weckesser warren.weckesser@enthought....
Sun Jun 13 14:41:31 CDT 2010

David Goldsmith wrote:
> Hi!  For the Examples in the numpy docstrings, we have the convention 
> that we do not need to include "import numpy" (because that is done by 
> our automated example tester) but when we're using a numpy namespace 
> object, we need to prefix it with "np." (because that's how our 
> automated tester is importing it).  Is there a similar convention for 
> docstring Examples in scipy?

According to http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines, 
"The examples may assume that import numpy as np is executed before the 
example code in numpy, and import scipy as sp in scipy. "  But sp does 
not appear to be widely used; I can only find it used in 
ndimage.geometric_transform and ndimage.map_coordinates.


> DG
> ------------------------------------------------------------------------
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev

More information about the SciPy-Dev mailing list