[Scipy-tickets] [SciPy] #1233: Weired test failure in airye function depending on test context in scipy 0.8

SciPy Trac scipy-tickets@scipy....
Thu Jul 15 02:27:06 CDT 2010


#1233: Weired test failure in airye function depending on test context in scipy
0.8
---------------------------+------------------------------------------------
 Reporter:  cjgohlke       |       Owner:  pv   
     Type:  defect         |      Status:  new  
 Priority:  normal         |   Milestone:  0.8.0
Component:  scipy.special  |     Version:  0.7.0
 Keywords:                 |  
---------------------------+------------------------------------------------
 This error was discussed on SciPy-Dev at [http://mail.scipy.org/pipermail
 /scipy-dev/2010-July/015251.html].

 Using numpy 1.4.1 and scipy 0.8rc2 built with msvc9, ifort, and MKL, on
 Python 2.6.5 for Windows I see this test failure most of the time (but not
 always):

 {{{
 ======================================================================
 FAIL: Real-valued Bessel domains
 ----------------------------------------------------------------------
 Traceback (most recent call last):
    File
 "X:\Python26\lib\site-packages\scipy\special\tests\test_basic.py", line
 1691, in test_ticket_854
      assert not isnan(airye(-1)[2:4]).any(), airye(-1)
 AssertionError: (nan, nan, nan, nan)

 }}}

 This failure is specific for the 32 bit build and only appears when I run
 {{{
 python -c"import scipy;scipy.test()"
 }}}
 but not in
 {{{
 python -c"import scipy.special;scipy.special.test()"
 }}}


 The failure also does not occur if I disable the function calls to jv(0.5,
 -1), iv(0.5, -1), and yv(0.5, -1) a few lines before the failing airye(-1)
 call:

 {{{

 def test_ticket_854(self):
     """Real-valued Bessel domains"""
     # assert isnan(jv(0.5, -1))  # <--
     # assert isnan(iv(0.5, -1))  # <--
     # assert isnan(yv(0.5, -1))  # <--
     assert isnan(yv(1, -1))
     assert isnan(kv(0.5, -1))
     assert isnan(kv(1, -1))
     assert isnan(jve(0.5, -1))
     assert isnan(ive(0.5, -1))
     assert isnan(yve(0.5, -1))
     assert isnan(yve(1, -1))
     assert isnan(kve(0.5, -1))
     assert isnan(kve(1, -1))
     assert isnan(airye(-1)[0:2]).all(), airye(-1)
     assert not isnan(airye(-1)[2:4]).any(), airye(-1)  # <--
 }}}

 Taking a look at the C code of the cephes jv, iv, and yv functions, I
 noticed that they call 'mtherr("...", DOMAIN);' right before returning
 NPY_NAN as the result. When disabling all calls to mtherr() in the jv, iv,
 and yv functions, the test_ticket_854 test always succeeds.

 A patch is attached. I don't suggest that the patch is the correct fix for
 the problem, but it gives a hint where to further investigate.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1233>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list