NESTCollaboration / nestpy

Raw Python bindings to the NEST library using pybind11.
GNU General Public License v3.0
13 stars 19 forks source link

Add lock of random seed #106

Closed dachengx closed 10 months ago

dachengx commented 10 months ago

Depends on https://github.com/NESTCollaboration/nest/pull/180

Add a lock of seed.

nest_rng = nestpy.RandomGen.rndm()
nest_rng.set_seed(0)
nest_rng.lock_seed()
nest_rng.set_seed(0)

will give you an error like

RuntimeError: You can not change the seed because it is locked.

if run

nest_rng.unlock_seed()

then nest_rng.set_seed(0) will not give you error.

grischbieter commented 10 months ago

The python 3.6 checks never pass, that's an issue with the python versions available to our CI. So it's okay to ignore that test's failure.