[NumPy-Tickets] [NumPy] #1512: Need tests for random.randn() and similiar

NumPy Trac numpy-tickets@scipy....
Sun Jun 13 12:52:09 CDT 2010


#1512: Need tests for random.randn() and similiar
-----------------------------------------------------+----------------------
 Reporter:  vincentdavis                             |       Owner:  somebody
     Type:  enhancement                              |      Status:  new     
 Priority:  normal                                   |   Milestone:  2.0.0   
Component:  numpy.testing                            |     Version:  1.4.0   
 Keywords:  random seed randn testing numpy.testing  |  
-----------------------------------------------------+----------------------
 A Scipy test failed do to a seeded randn() not returning the expected
 results (details below). I seemed to be an issue specific to enthought
 dist 6.2-1. This highlights the need for a test of randn() and similar.

 Correct results as tested on several machines
 From Josef, I assume windows
 >>>>> np.random.seed(0)
 >>>>> np.random.randn(3)
 >> array([ 1.76405235,  0.40015721,  0.97873798])

 Results from enthought 6.2-1  (very different)
 On my machine OSX py 2.6.5, numpy 1.4.0 scipy 8.0b
 >>>> np.random.seed(0)
 >>>> np.random.randn(3)
 > array([ 0.06897149,  1.32078057,  1.5997924 ])

 Also correct
 ubuntu 10.0.4  py 2.5.6 current scipy and numpy just built from the git
 source.
 >>> np.random.seed(0)
 >>> np.random.randn(3)
 array([ 1.76405235,  0.40015721,  0.97873798])


 http://permalink.gmane.org/gmane.comp.python.scientific.devel/13726


 Failed scipy test on
 On my machine OSX py 2.6.5, numpy 1.4.0 scipy 8.0b enthought 6.2-1
 FAIL: test_stats.test_kstest
 ----------------------------------------------------------------------
 Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6
 /site-packages/nose/case.py",
 line 186, in runTest
   self.test(*self.arg)
  File "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6
 /site-packages/scipy/stats/tests/test_stats.py",
 line 1228, in test_kstest
   assert_almost_equal( D, 0.12464329735846891, 15)
  File "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6
 /site-packages/numpy/testing/utils.py",
 line 459, in assert_almost_equal
   raise AssertionError(msg)
 AssertionError:
 Arrays are not almost equal
  ACTUAL: 0.093893737596468518
  DESIRED: 0.1246432973584689

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1512>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list