[Numpy-discussion] profile reveals calls to astype()

Curzio Basso curzio.basso at unibas.ch
Fri Apr 8 06:30:05 EDT 2005

Todd Miller wrote:

> astype() is used in a bunch of places, including the C-API,  so it's
> hard to guess how it's getting called with the information here.  In

ok, so probably C functions are somehow 'transparent' to the profiler which does not report them,
but reports the python functions called by the C one...

>>>>from yourmodule import newfoo  # you redefined foo to accept N as a parameter
>>>>import pdb
> (pdb) s  # step along a little to get into newfoo()
> ... step output
> (pdb) import numarray.numarraycore as nc
> (pdb) break nc.astype

strange, what I get now is:

> (Pdb) b nc.astype
> *** The specified object 'nc.astype' is not a function
> or was not found along sys.path.

and in fact if I look at nc.__dict__ there is no 'astype' key. I'm running the whole program (rather
than just the function) under ipython, starting it with

> %run -d myprog.py

maybe this could mess up things?


More information about the NumPy-Discussion mailing list