tisimst/pyDOE

Request that you use np.random.RandomState for random draws

Opened this issue · 3 comments

The code would be much more flexible if you passed a numpy random state in and used that for the random draws. Object oriented random number generator would allow the user to create and manage multiple lhs (and other) designs simultaneously.

def lhs(rstate, n, samples=None, criterion=None, iterations=None):
    """
    Generate a latin-hypercube design

    Parameters

    rstate : np.random.RandomState
         Random state which controls the seed and random draws

An example use is:

# set the random state once for each independent design
rstate = np.random.RandomState(master_seed)  

# in the source code the draw is now controlled by the explicit random state object
u = rstate.rand(samples, n)   # instead of np.random.rand(samples, n)


This design philosophy is much more flexible.

It doesn't seem to be much activity in this project.

This feature has been implemented and released in this fork.

All, please accept my apologies for not updating this repo with the recent pull requests. I haven't had much time to do so, being extremely busy with my previous employment, but I recently changed jobs and hope to have much more time to get things up to date. Thanks for your interest and support!

@RickardSjogren and @tisimst you two should coordinate. Maybe both of you can be repo owners.
Having one really good package with multiple contributors is what we all need. The new changes in pydoe2 are excellent (including the addition of RandomState).

Ideally there could be a single DOE package and it could somehow get included into the Anaconda distribution.