mvpa2.testing.tools.reseed_rng

mvpa2.testing.tools.reseed_rng()

Decorator to assure the use of MVPA_SEED while running the test

It resets random number generators (both python and numpy) to the initial value of the seed value which was set while importing mvpa, which could be controlled through configuration/environment.

Examples

>>> @reseed_rng()
... def test_random():
...     import numpy.random as rnd
...     print rnd.randint(100)

Previous topic

mvpa2.testing.tools.raises

Next topic

mvpa2.testing.tools.skip_if_no_external

NeuroDebian

NITRC-listed