bashtage/ng-numpy-randomstate

help on RandomState functions show numpy examples

Closed this issue · 3 comments

Just did the following

from randomstate.prng.xorshift128 import RandomState
r = RandomState()
help(r.normal)

and it finishes with

Examples
    --------
    Draw samples from the distribution:
    
mu, sigma = 0, 0.1 # mean and standard deviation
s = np.random.normal(mu, sigma, 1000)

Is this an inconsistency? Should it not be something along the lines of

from randomstate.prng.xorshift128 import RandomState
mu, sigma = 0, 0.1 # mean and standard deviation
prng = RandomState(seed)
s = prng.normal(mu, sigma, 1000)

This is mostly intentional since all modules derive from the NumPy RandomState and so use common docs. I decided to leave it point to numpy.random and assumed that users could substiture the correct prng as needed.

It help me ensure that docstring changes and other upstream changes are propogated since the diff is similar.

Aha I see, I did follow your docs when I started with the package, but wanted to double check whether this was intentional or not.

Thanks!