np.lookfor -- still supported / working ?
Hi all, I recently discovered numpy's lookfor function, which is supposed to look through "all kinds" of doc strings and list relevant functions related to given keywords. However it does not seem to work for me:
N.__version__ '1.3.0' N.lookfor('fft', module=None, import_modules=True, regenerate=False) Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line 622, in lookfor found.sort(relevance_sort) TypeError: comparison function must return int 1/2 # I use from future import division .... 0.5
import wx N.lookfor('background', module='wx', import_modules=True, regenerate=False) Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line 574, in lookfor cache = _lookfor_generate_cache(module, import_modules, regenerate) File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line 729, in _lookfor_generate_cache doc = inspect.getdoc(item) File "C:\cygwin\home\haase\Priithon_25_win\Python25\lib\inspect.py",
I especially like, that it is supposed to work for any other (not just numpy or scipy) module. But that also doesn't work: line 313, in getdoc doc = object.__doc__ NameError: Unknown C global variable
I tried it on more recent numpy (1.5.1 I think) and got same problems. Any comments ? Thanks, Sebastian Haase
On Sat, 11 Dec 2010 23:40:35 +0100, Sebastian Haase wrote:
Hi all,
I recently discovered numpy's lookfor function, which is supposed to look through "all kinds" of doc strings and list relevant functions related to given keywords. However it does not seem to work for me:
N.__version__ '1.3.0' N.lookfor('fft', module=None, import_modules=True, regenerate=False) [clip]
Worksforme
import numpy as np np.__version__ '1.5.1' np.lookfor('fft', module=None, import_modules=True, regenerate=False) Search results for 'fft'
numpy.fft.hfft Compute the FFT of a signal whose spectrum has Hermitian symmetry. ... [clip]
import wx N.lookfor('background', module='wx', import_modules=True, regenerate=False) Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line 574, in lookfor cache = _lookfor_generate_cache(module, import_modules, regenerate) File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line 729, in _lookfor_generate_cache doc = inspect.getdoc(item) File "C:\cygwin\home\haase\Priithon_25_win\Python25\lib\inspect.py",
I especially like, that it is supposed to work for any other (not just numpy or scipy) module. But that also doesn't work: line 313, in getdoc doc = object.__doc__ NameError: Unknown C global variable [clip]
That's more of an issue in the `wx` module in that it behaves in a non- standard way under introspection. But yes, it would be possible to catch that exception and ignore it. -- Pauli Virtanen
participants (2)
-
Pauli Virtanen
-
Sebastian Haase