pyDOE icon indicating copy to clipboard operation
pyDOE copied to clipboard

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

Open eflanigan00 opened this issue 7 years ago • 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.

eflanigan00 avatar Nov 30 '17 02:11 eflanigan00

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

This feature has been implemented and released in this fork.

RickardSjogren avatar Jan 26 '18 11:01 RickardSjogren

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!

tisimst avatar Feb 01 '18 18:02 tisimst

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

eflanigan00 avatar Feb 03 '18 00:02 eflanigan00