You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice to have a docstring search that could be used interactively:
>>> import numpy as np
>>> np.lookfor("eigenvalue hermitean")
Search results for 'eigenvalue hermitean'
-----------------------------------------
numpy.linalg.eigvalsh
Compute the eigenvalues of a Hermitean or real symmetric matrix.
numpy.linalg.eigh
Compute eigenvalues for a Hermitian or real symmetric matrix.
numpy.linalg.eigvals
Compute the eigenvalues of a general matrix.
>>> np.lookfor("spline interpolat", module="scipy")
Search results for 'spline interpolat'
--------------------------------------
scipy.interpolate.spline
Interpolate a curve (xk,yk) at points xnew using a spline fit.
scipy.interpolate.RectBivariateSpline
Bivariate spline approximation over a rectangular mesh.
scipy.interpolate.InterpolatedUnivariateSpline
Interpolated univariate spline approximation. Identical to
scipy.ndimage.shift
Shift an array.
scipy.ndimage.zoom
Zoom an array.
scipy.interpolate.splrep
Find the B-spline representation of 1-D curve.
... long result, shown in a pager ...
This patch implements a simple-minded docstring search:
_lookfor_generate_cache walks the contents of the module to search, collecting docstrings
lookfor splits the search string and searchs for entries that contain all parts. No stemming etc. is done.
lookfor sorts the results by a Harrison-Stetson relevancy metric (ie. I just wrote up some heuristics to distinguish "more relevant" results from "less relevant"). It appears to work ok, but probably could be improved.
lookfor either prints or calls a pager (via pydoc, for long listings) to show the results
No automated tests at this time, sorry, I only did manual testing now.
Activity
numpy-gitbot commentedon Oct 19, 2012
Attachment added by @pv on 2008-04-10: ticket-734-lookfor.patch
numpy-gitbot commentedon Oct 19, 2012
@teoliphant wrote on 2008-04-11
Added in r5024