-
Notifications
You must be signed in to change notification settings - Fork 50
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
Random Seed as Parameter & Added Res Validity Check #7
base: master
Are you sure you want to change the base?
Conversation
Hi, Do we really want to set the numpy seed inside the functions? It may silently mess the global state of applications that consume the library and provoke strange bugs. |
Hi @pvigier, That's a really good point for the case when people don't want control over the seed. This could be handled by including a |
Hello, I was about to submit PR with the same goal as this one but with different implementation. In my project, I need to have even better control over the random state to the extend that it is not possible to change global seed Additionally, @Permafacture says in #15 that the developers recommendation were implemented but I see here that devs themselves recommend to use RandomState as well. Do you think that making PR with Random State would make it into |
@jaroslavknotek I might be misunderstanding. I wrote a PR that that has not been accepted to use the best practice the numpy developers intend for people to use. I did not say the current main branch had implemented random numbers correctly. Are you advocating for my PR to be accepted or are you saying you'd start a new PR and if so how would it be different? |
Sorry for misunderstanding. My point is that on one hand I am in-fact advocating for better control over using random seeds but on the other hand I don't think that your implementation improved the situation much. To support that I added a link to numpy developers who advise to use The use of the latter, regardless of whether used outside of noise function (as original implementation) or inside (your implementation), is not suitable as it changes a global behavior of numpy random number generator. In a situation where you use separate libraries that need to create random number, you need both to generate it without affecting the other. More specifically, using perlin noise function that do |
I don't think you understand my changes. |
This PR lets the user set a random seed value for both the 2d and 3d perlin noise functions