We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 055452f + 643ffbb commit c7defd7Copy full SHA for c7defd7
doc/devel/testing.rst
@@ -87,10 +87,12 @@ Random data in tests
87
Random data is a very convenient way to generate data for examples,
88
however the randomness is problematic for testing (as the tests
89
must be deterministic!). To work around this set the seed in each test.
90
-For numpy use::
+For numpy's default random number generator use::
91
92
import numpy as np
93
- np.random.seed(19680801)
+ rng = np.random.default_rng(19680801)
94
+
95
+and then use ``rng`` when generating the random numbers.
96
97
The seed is John Hunter's birthday.
98
0 commit comments