[SciPy-Dev] scipy.stats: some questions/points about distributions.py + reply on ticket 1493

nicky van foreest vanforeest@gmail....
Wed Apr 25 13:12:54 CDT 2012


Hi Josef,

Sorry for not responding earlier... too many obligations.

Before I get back to your earlier mail, I have some naive questions
about distributions.py. I hope you don't mind that I fire them at you.

1:

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L436

Is this code "dead"? Within distributions.py it is not called. Nearly
the same code is written here:

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L1180


2:

I have a similar point about:

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L358

What is the use of this code? It is not called anywhere. Besides this,
from our  discussion about ticket 1493, this function returns the
centralized moments, while the "real" moment E(X^n) should be
returned. Hence, the code is also not correct, i.e., not in line with
the documentation.

3:

Suppose we would turn xa and xb into private atrributes _xa and _xb,
then i suppose that

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L883

requires updating.


4:

I have a hard time understanding the working (and goal) of

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L883


Where is the right place to ask for some clarification? Or should I
just think harder?

5:

The definition of arr in

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L60

does not add much (although it saves some characters at some points of
the code), but makes it harder to read the code for novices like me.
(I spent some time searching for a numpy function called arr, only to
find out later that it was just a shorthand only used in the
distribution.py module). Would it be a problem to replace such code by
the proper numpy function?

6:

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L538

contains a typo. It should be Weisstein.

7:

https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L625


This code gives me even a harder time than _argsreduce. I have to
admit that I simply don't know what this code is trying to
prevent/check/repair. Would you mind giving a hint?

Nicky


More information about the SciPy-Dev mailing list