graspologic
graspologic copied to clipboard
Add option to utilize numpy.random.Generator object in sample_edges
Issue:
Sample_edges utilizes numpy.random.RandomState, would be nice to be able to utilize a numpy.random.Generator object as well.
Solution:
Add option input to sample_edges that accepts a numpy.random.Generator object. If this input is provided then sample_edges should use the numpy.random.Generator object to sample from bernoulli.
References
numpy.random.Generator is the newly adopted pseudo-random number generator utilized and maintained by numpy. Check out here in the numpy doc the compatibility guarantee for numpy.random.RandomState which is what is currently being used.
@bdpedigo I opened the new issue to add this feature.
Please let me know if it is still something desirable.
issue looks good, are you planning on adding this to sample_edges
somehow?
Yes, my plan is to add as input the random.number.Generator to the sample_edges. If this input isn't given that function work as it is , if the input is given than use the provided object.