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

Todd Miller jmiller at stsci.edu
Fri Apr 8 06:45:13 CDT 2005


On Fri, 2005-04-08 at 09:29, Curzio Basso wrote:
> 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.run("newfoo(N=2)")
> > 
> > (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?

No.  I should have said "b nc.NumArray.astype".  I just tried this out
with an astype() callback from numarray.convolve's C-code and it worked
OK for me.

Regards,
Todd







More information about the Numpy-discussion mailing list