[Scipy-tickets] [SciPy] #1815: stats.distributions: no ValueError if too many args

SciPy Trac scipy-tickets@scipy....
Mon Jan 14 22:18:06 CST 2013


#1815: stats.distributions: no ValueError if too many args
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  rgommers   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.11.0     
 Keywords:               |  
-------------------------+--------------------------------------------------
 distribution methods don't raise an error if there are too many arguments
 in the call to a method.

 for example

 {{{
 >>> stats.gamma.pdf(x, 3., loc = 0., scale = 2.)
 array([ 0.        ,  0.0146116 ,  0.0442711 ,  0.07545108,  0.10160277,
         0.12025087,  0.13116361,  0.13522892,  0.13378768,  0.12825781])
 >>> stats.gamma.pdf(x, 2, 3., loc = 0., scale = 2.)
 array([ 0.        ,  0.10520349,  0.15937595,  0.18108259,  0.18288499,
         0.17316126,  0.15739634,  0.13909261,  0.12040891,  0.10260625])
 >>> stats.gamma.pdf(x, 3., 2, 5, loc = 0., scale = 2.)
 array([ 0.        ,  0.0146116 ,  0.0442711 ,  0.07545108,  0.10160277,
         0.12025087,  0.13116361,  0.13522892,  0.13378768,  0.12825781])
 >>> stats.gamma.pdf(x, 3., 2, 5, 6, loc = 0., scale = 2.)
 array([ 0.        ,  0.0146116 ,  0.0442711 ,  0.07545108,  0.10160277,
         0.12025087,  0.13116361,  0.13522892,  0.13378768,  0.12825781])
 }}}

 The distributions know the number of shape parameters and could check how
 many the user has given.

 {{{
 >>> stats.gamma.numargs
 1
 }}}

 Problem comes from the use of *args, **kwds

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


More information about the Scipy-tickets mailing list