[SciPy-user] nunmpy.lookfor and scipy submodules

Emmanuelle Gouillart emmanuelle.gouillart@normalesup....
Sat Jun 27 17:06:35 CDT 2009


	Hi list,

	while working on a course about scientific computing with Python,
I found myself playing with numpy.lookfor. To my surprise, I found that
the submodules of scipy are never searched by numpy.lookfor (see example
below). Apparently, this comes from the fact that the submodules are not
in scipy.__all__. I'm sure this is a very naive question, but why is it
so ? It can be quite confusing for people looking for documentation when
they don't find any match for 'optimize' in scipy... I'm using numpy
1.2.1 and scipy 0.7.

	Thanks in advance,

	Emmanuelle 

Example:

>>> np.lookfor('optimize', module=scipy, import_modules=True)
Search results for 'optimize'
-----------------------------
>>> np.lookfor('interpol', module=scipy, import_modules=True)
Search results for 'interpol'
-----------------------------
scipy.interp
    One-dimensional linear interpolation.
scipy.misc.imrotate
    Rotate an image counter-clockwise by angle degrees.
scipy.sinc
    Return the sinc function.
scipy.polyfit
    Least squares polynomial fit.
scipy.bartlett
    Return the Bartlett window.
scipy.ma.polyfit
    Least squares polynomial fit.
>>> # nothing from scipy.interpolate !!
>>> np.lookfor('filename', os)
Search results for 'filename'
-----------------------------
os.open
    Open a file (for low level IO).
os.mknod
    Create a filesystem node (file, device special file or named pipe)
os.mkfifo
    Create a FIFO (a POSIX named pipe).
os.path.realpath
    Return the canonical path of the specified filename, eliminating any
os.walk
    Directory tree generator.
os.path.walk
    Directory tree walk with callback function.
>>> # With os, submodules are also searched


More information about the SciPy-user mailing list