shunwang / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

Fix test failures with numpy 1.8 #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On win-amd64-py2.7 with numpy 1.8dev, numexpr 2.2 fails 92 tests [1], all of 
them related to true division. 

Numpy 1.8 added a `from __future__ import division, ...` statement to 
numpy.testing.__init__.py [2], which "leaks" into the numexpr tests. 

The following patch fixes all test failures. On the other hand, this might 
expose a real issue: A `from X import *` statement, where X has true division 
enabled, can unexpectedly change numexpr calculations...

diff -r d4912e125346 numexpr/tests/test_numexpr.py --- a/numexpr/tests/test_numexpr.py Tue Sep 03 15:11:44 2013 +0200 +++ b/numexpr/tests/test_numexpr.py Sat Sep 07 17:55:16 2013 -0700 @@ -20,7 +20,8 @@ sin, cos, tan, arcsin, arccos, arctan, arctan2, sinh, cosh, tanh, arcsinh, arccosh, arctanh, log, log1p, log10, exp, expm1) -from numpy.testing import * +from numpy.testing import (assert_equal, assert_array_equal,


[1] 
http://www.lfd.uci.edu/~gohlke/pythonlibs/tests/20130902-win-amd64-py2.7-numpy-1
.8.0.dev-86a6e6c/numexpr_test.txt
[2] https://github.com/numpy/numpy/blob/master/numpy/testing/__init__.py#L8

Original issue reported on code.google.com by cjgoh...@gmail.com on 8 Sep 2013 at 1:14

GoogleCodeExporter commented 9 years ago
Urgh, that was an ugly secondary effect of importing everything from 
numpy.testing.  So I decided to apply your patch and do a new release.

Thanks for the patch!

Original comment by fal...@gmail.com on 8 Sep 2013 at 6:20