[Numpy-discussion] ANN: line_profiler 1.0b2 released

Nicolas Pinto pinto@mit....
Mon Jul 20 01:42:38 CDT 2009


Thanks a lot Robert for this very useful tool!

I was wondering if there is a way to make it work with Cython code (see
below) ?

Sincerely,

Nicolas

fib.pyx:

@profile
def fib(n):
    """Print the Fibonacci series up to n."""
    a, b = 0, 1
    while b < n:
        a, b = b, a + b

test.py:

import pyximport
pyximport.install()
import fib
fib.fib(100)

% python kernprof.py -vl test.py
Wrote profile results to test.py.lprof
Timer unit: 1e-06 s

Traceback (most recent call last):
  File "kernprof.py", line 167, in <module>
    sys.exit(main(sys.argv))
  File "kernprof.py", line 155, in main
    execfile(script_file, ns, ns)
  File "test.py", line 5, in <module>
    import fib
  File
"/usr/lib/python2.5/site-packages/Cython-0.11.2-py2.5-linux-x86_64.egg/pyximport/pyximport.py",
line 288, in load_module
    self.pyxbuild_dir)
  File
"/usr/lib/python2.5/site-packages/Cython-0.11.2-py2.5-linux-x86_64.egg/pyximport/pyximport.py",
line 154, in load_module
    raise ImportError("Building module failed: %s" % e)
ImportError: Building module failed: 'builtin_function_or_method' object has
no attribute '__dict__'

On Thu, Feb 19, 2009 at 5:21 PM, Robert Kern <robert.kern@gmail.com> wrote:

> http://pypi.python.org/pypi/line_profiler/
> http://packages.python.org/line_profiler/
>
> This release fixes the "negative timings" issue on Windows.
>
> Future announcements will occur on python-announce. I just wanted to
> make sure my earliest users here who ran into this bug are aware of
> the fix.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090720/67d9c1b8/attachment.html 


More information about the NumPy-Discussion mailing list