[SciPy-User] scipy.weave.blitz bug using functions

Felix Schlesinger schlesin@cshl....
Sun Oct 18 20:23:45 CDT 2009


is this a bug or am I doing something wrong?

import scipy
arr = scipy.random.rand(1000000)
res = scipy.zeros_like(arr)
blitz("""res = sin(2*sin(arr+1))""")

NameError                                 Traceback (most recent call last)

in blitz(expr, local_dict, global_dict, check_size, verbose, **kw)
     32     #    of time.  It also can cause core-dumps if the sizes
of the inputs
     33     #    aren't compatible.
---> 34     if check_size and not
     35         raise 'inputs failed to pass size check.'

in check_expr(expr, local_vars, global_vars)
     49         if isnumeric(val):
     50             values[var] = val
---> 51     exec(expr,values)
     52     try:
     53         exec(expr,values)

NameError: name 'sin' is not defined

If I do
blitz("""res = sin(2*sin(arr+1))""", check_size=0)
it works. Seems to me the check_size code tries to check the size of
the array 'sin', instead of recognizing it as a function.


More information about the SciPy-User mailing list