[Numpy-discussion] Four bugs in Numexpr and another repository

David M. Cooke cookedm at physics.mcmaster.ca
Thu Apr 19 16:03:45 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ivan Vilata i Balaguer wrote:
> Hi all,
> 
> Francesc and I have found four bugs in Numexpr while developing
> PyTables.  To spare you from the gory details, I'll point you to the
> PyTables Trac instance, where bugs are commented and patches are
> available which should be more or less readily applicable to mainstream
> Numexpr:
> 
> 1. VariableNode error when numexpr is asked to evaluate some functions
>    (arc*, pow): http://www.pytables.org/trac/ticket/54
> 
>    >>> numexpr.evaluate('arcsin(0.5)')
>    Traceback (most recent call last):
>      ...
>    TypeError: 'VariableNode' object is not callable

Looks like an oversight. Fixed in svn (r2934).
> 
> 2. 'int' object has no attribute '__gt__' error in tables.numexpr (also
>    affects to original numexpr): http://www.pytables.org/trac/ticket/55
> 
>    >>> numexpr.evaluate('cos(1.3) < 0')
>    Traceback (most recent call last):
>      ...
>    AttributeError: 'int' object has no attribute '__gt__'

Fixed, r2935.

> 3. Wrong behaviour of where function of numexpr (als affects to original
>    numexpr): http://www.pytables.org/trac/ticket/56
> 
>    >>> a = numpy.arange(0,5)
>    >>> numexpr.evaluate('where(a < 2, 1, 0)')
>    Traceback (most recent call last):
>      ...
>    NotImplementedError: couldn't find matching opcode for 'where_bbbb'

Got to stare at this one. Support for True and False might be the best
thing here, so that the above is where_biii.

> 4. Segmentation fault with string constant expression:
>    http://www.pytables.org/trac/ticket/58
> 
>    >>> tables.numexpr.evaluate('"foo"')
>    Segmentation fault (core dumped)
> 
>    This in fact only applies to the PyTables version of Numexpr, which
>    includes the patches I've been sending here for a while.  I'm taking
>    this opportunity to point out that you can check that version out
>    from the PyTables Subversion repository:
>    http://www.pytables.org/svn/pytables/trunk/tables/numexpr/
> 
> If you need more help on this, don't hesitate to ask.  Thanks a lot!


> (Is it OK to report Numexpr bugs in the SciPy Trac instance?  And,
> what's the right capitalisation of "Numexpr"? ;) )

Yes; open a bug for #3 on the SciPy Trac, and assign them to me
(cookedm), so I don't forget about them. You can open a bug for adding
string expressions, so at least people can find it if they want. I'm
still not convinced of its usefulness (compared with the added complexity).

Looks like I use either numexpr or Numexpr for capitialisation (NumExpr
on the SciPy wiki, but that's just wikification).

- --
|>|\/|<
/------------------------------------------------------------------\
|David M. Cooke              http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJ8shN9ixZKFWjRQRAvUpAJ9fjY434fuSokMXGZK8wHbv3O778gCgtl3q
Q/E8Lvmk/EyJNCwr66Vay2Y=
=muco
-----END PGP SIGNATURE-----



More information about the NumPy-Discussion mailing list