Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ Random data in tests
Random data is a very convenient way to generate data for examples,
however the randomness is problematic for testing (as the tests
must be deterministic!). To work around this set the seed in each test.
For numpy use::
For numpy's default random number generator use::

import numpy as np
np.random.seed(19680801)
rng = np.random.default_rng(19680801)

and then use ``rng`` when generating the random numbers.

The seed is John Hunter's birthday.

Expand Down