Helium6CRES / he6-cres-spec-sims

A python package to simulate cres data for the 6He CRES experiment at CENPA (University of Washington).
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

single rng instance called from everywhere #6

Closed buzinsky closed 3 months ago

buzinsky commented 3 months ago

Removes all np.random calls. Everything goes through a single rng instance, which is called from everywhere via the config class

I was concerned that python passes arguments by value, not reference. This would be catastrophic, as moving around this rng would mean calls of the copy of the rng would not "progress" it, and you would keep getting the same numbers. This seems to be not the case

rand_test.py.txt

I get the same sequence of numbers despite the order of the last few lines. I do not get the same 1st number over and over

To pull from entropy from your OS (apparently random numbers, instead of a set seed, set the seed to None). I don't believe we handle defaults right now

buzinsky commented 3 months ago

Also confirmed, same seed produces same csv. Different seed produces different csv