[Scipy-tickets] [SciPy] #1900: Distributions: restrictions on parameter values at a lower level

SciPy Trac scipy-tickets@scipy....
Wed Apr 24 10:20:02 CDT 2013


#1900: Distributions: restrictions on parameter values at a lower level
-------------------------+--------------------------------------------------
 Reporter:  Sytse        |       Owner:  somebody   
     Type:  enhancement  |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  Other        |     Version:  0.12.0     
 Keywords:               |  
-------------------------+--------------------------------------------------
 A few recent tickets (#1880, #1883, #1895) show that restrictions on
 parameter values are not always properly specified. In the folded normal
 and the non-central t distributions they are not specified in an
 _argcheck() for the distribution class itself, but all parameter
 restrictions appear to be inherited as the restriction: 'par > 0' from a
 parent class 'rv_continuous' .

 Although 'par > 0' is probably the most frequent restriction, it is not a
 fundamental restriction. I mean: there is no reason why in priciple all
 parameter values should be positive, except for a few. The decision to
 specify 'par > 0' in the parent classes and only to modify if necessary in
 the distribution classes may lead to unclarity and bugs at the
 distribution level.

 Wouldn't the design become clearer if no parameter restrictions were
 imposed on the parent level and all restrictions ('> 0', '>= 0',
 'integer', etc) were defined explicitly for each distribution class
 separately?
 No need to say in a Python environment that a clear and logical design is
 extremely important for readability and eventually for maintainability of
 code.

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


More information about the Scipy-tickets mailing list