perlin-numpy icon indicating copy to clipboard operation
perlin-numpy copied to clipboard

Random Seed as Parameter & Added Res Validity Check

Open AyrtonB opened this issue 4 years ago • 8 comments

This PR lets the user set a random seed value for both the 2d and 3d perlin noise functions

AyrtonB avatar Feb 12 '21 19:02 AyrtonB

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.

pvigier avatar Feb 13 '21 10:02 pvigier

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 if seed is not None and only running np.random.seed(seed) if that's the case.

AyrtonB avatar Feb 13 '21 18:02 AyrtonB

@AyrtonB I've implemented seed setting the way numpy developers recommend now in #15

Permafacture avatar Feb 10 '24 21:02 Permafacture