[Numpy-discussion] additions to random: innovative names vs. algorithm specification

Robert Kern robert.kern@gmail....
Thu Jul 29 15:37:11 CDT 2010


On Thu, Jul 29, 2010 at 09:41, Charles R Harris
<charlesr.harris@gmail.com> wrote:
>
> On Thu, Jul 29, 2010 at 8:25 AM, Alan G Isaac <alan.isaac@gmail.com> wrote:
>>
>> Rather than just looking for a new name (e.g., znormal),
>> would it not be better to decide on a syntax for specifying
>> PRNG algorithms?  (E.g., MATLAB takes such an
>> approach:
>> http://www.mathworks.com/access/helpdesk/help/techdoc/math/brt5wsv.html)
>>
>> Wouldn't this meet the need for replicability with much greater
>> generality?
>
> That's probably a better idea. The sort functions have the 'kind' keyword to
> select between three algorithms and such an addition to the random number
> functions might be a good thing to have for the future if other algorithms
> get updated/changed. If such a keyword is added it can be given a value of
> None where there are no selections available.

There is a good design principle that when you have a keyword argument
which you only expect to pass literals to, you should make multiple
functions instead (Book of Guido, 7:42). It's worth noting that this
MATLAB API is deprecated.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the NumPy-Discussion mailing list