Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eflanigan00 opened this issue Nov 30, 2017 · 3 comments
Open

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

eflanigan00 opened this issue Nov 30, 2017 · 3 comments

Comments

@eflanigan00
Copy link

eflanigan00 commented Nov 30, 2017

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
Copy link

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

This feature has been implemented and released in this fork.

@tisimst
Copy link
Owner

tisimst commented Feb 1, 2018

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
Copy link
Author

eflanigan00 commented Feb 3, 2018

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

@cruoti cruoti mentioned this issue Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants