lemire / fastrand

Fast random number generation in an interval in Python: Up to 10x faster than random.randint.
Apache License 2.0
88 stars 12 forks source link

Seeding #11

Closed ebergstr closed 5 years ago

ebergstr commented 5 years ago

Is there a way to set our own seed for reproducibility purposes? Similarly for ensuring different streams while parallelizing code...

lemire commented 5 years ago

Have you tried, for example, pcg32_seed?

ebergstr commented 5 years ago

That does not appear to be an available module:

AttributeError: module 'fastrand' has no attribute 'pcg32_seed'

EDIT: I realized the package has been updated since I downloaded it. The module is now present, however, i get a "Segmentation fault" when attempting to pass my own seed.

lemire commented 5 years ago

Yes. This should be fixed in version 1.2. Can you check? If not available now, it should soon be available.

lemire commented 5 years ago

https://pypi.org/project/fastrand/

ebergstr commented 5 years ago

It appears to be working now, thanks!