[SciPy-dev] weave -- inline C/C++ in Python, an implementation

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Jan 5 11:45:20 CST 2002


>>>>> "eric" == eric  <eric at scipy.org> writes:

    eric> balls on the documentation page and source.  Also, if people
    eric> could download the zip/exe/tar.gz files and let me know of
    eric> any failures that would be helpful.  The website provides

Here are my test results.  I'm running this on a woody debian machine.

Python 2.1.1 (built from source),

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011006 (Debian prerelease)

scipy CVS tree (absolutely *the* latest)

an older version of the scipy CVS tree is also installed
(i.e. pre-weave).

I tested like so:

$ cd cvs/scipy/
$ python
>>> import weave
>>> weave.test()

It works for a while and then gives up with this error.

[snip]
repairing catalog by removing key
Erepairing catalog by removing key
F.........F.......warning: specified build_dir '_bad_path_' does not exist or is or is not writable. Trying default locations
....warning: specified build_dir '_bad_path_' does not exist or is or is not writable. Trying default locations
..................................................................................................
======================================================================
ERROR: result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "weave/tests/test_blitz_tools.py", line 148, in check_5point_avg_2d
    self.generic_2d(expr)
  File "weave/tests/test_blitz_tools.py", line 124, in generic_2d
    standard,compiled = self.generic_test(expr,arg_dict,type,size)
  File "weave/tests/test_blitz_tools.py", line 81, in generic_test
    blitz_tools.blitz(expr,arg_dict,{},verbose=0)
  File "weave/blitz_tools.py", line 100, in blitz
    function_catalog.add_function(expr,func,module_dir)
  File "weave/catalog.py", line 525, in add_function
  File "/usr/local/lib/python2.1/dumbdbm.py", line 129, in __delitem__
    del self._index[key]
KeyError: __path__ff
======================================================================
FAIL: Test persisting a function in the default catalog
----------------------------------------------------------------------
Traceback (most recent call last):
  File "weave/tests/test_catalog.py", line 280, in check_add_function_persistent1
    assert(i in pfuncs)
AssertionError
======================================================================
FAIL: Shouldn't get a single file from the temp dir.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "weave/tests/test_catalog.py", line 207, in check_get_existing_files2
    assert(len(files) == 1)
AssertionError
----------------------------------------------------------------------
Ran 184 tests in 423.602s

FAILED (failures=2, errors=2)
<unittest.TextTestRunner instance at 0x8200ef4>
>>>  

I dont have the time to track it down any more.  I just hope this
information is helpful.

Travis and Robs test cases seem to work perfectly well for me.

>>> from Numeric import *
>>> import weave
>>> a = ones((5,5),Float32)
>>> b = ones((5,5),Float32)
>>> weave.blitz("a = a + b")
>>> a
array([[ 2.,  2.,  2.,  2.,  2.],
       [ 2.,  2.,  2.,  2.,  2.],
       [ 2.,  2.,  2.,  2.,  2.],
       [ 2.,  2.,  2.,  2.,  2.],
       [ 2.,  2.,  2.,  2.,  2.]],'f')

>>> a=1 
>>> b = 100.0
>>> weave.blitz(foo)

Both work fine.

prabhu



More information about the Scipy-dev mailing list