Skip to content

Commit 98df634

Browse files
committed
tests: Use np.random.RandomState where necessary
1 parent 2fdf6e3 commit 98df634

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_interpolation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,8 @@ def test_interp_complex(self, dtype):
887887
sc.coordinates.data[:] = [.5, .5, .5]
888888

889889
fc = Function(name="fc", grid=grid, npoint=2, dtype=dtype)
890-
fc.data[:] = np.random.randn(*grid.shape) + 1j * np.random.randn(*grid.shape)
890+
rng = np.random.RandomState(0)
891+
fc.data[:] = rng.randn(*grid.shape) + 1j * rng.randn(*grid.shape)
891892
opC = Operator([sc.interpolate(expr=fc)], name="OpC")
892893
opC()
893894

@@ -903,7 +904,8 @@ def test_interp_complex_and_real(self, dtype):
903904
coordinates=sc.coordinates)
904905

905906
fc = Function(name="fc", grid=grid, npoint=2, dtype=dtype)
906-
fc.data[:] = np.random.randn(*grid.shape) + 1j * np.random.randn(*grid.shape)
907+
rng = np.random.RandomState(0)
908+
fc.data[:] = rng.randn(*grid.shape) + 1j * rng.randn(*grid.shape)
907909
exprs = sc.interpolate(expr=fc) + scre.interpolate(expr=Real(fc))
908910
opC = Operator(exprs, name="OpC")
909911
opC()

0 commit comments

Comments
 (0)