tisimst / pyDOE

Design of experiments for Python
BSD 3-Clause "New" or "Revised" License
263 stars 114 forks source link

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

Open eflanigan00 opened 6 years ago

eflanigan00 commented 6 years ago

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.

RickardSjogren commented 6 years ago

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

This feature has been implemented and released in this fork.

tisimst commented 6 years ago

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!

eflanigan00 commented 6 years ago

@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.