From 7f620a9bb3f52c17f1c9169bf9857cbaf6194591 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 30 Jul 2024 23:19:07 -0700 Subject: [PATCH] modern rng approach --- opencl_fdtd/test_simulation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opencl_fdtd/test_simulation.py b/opencl_fdtd/test_simulation.py index c68a2cf..9c8649a 100644 --- a/opencl_fdtd/test_simulation.py +++ b/opencl_fdtd/test_simulation.py @@ -323,8 +323,9 @@ class JdotE_3DUniformDX(unittest.TestCase): self.epsilon = numpy.full(shape, 4, dtype=float) self.epsilon[self.src_mask] = 2 - e = numpy.random.randint(-128, 128 + 1, size=shape).astype(float) - h = numpy.random.randint(-128, 128 + 1, size=shape).astype(float) + rng = numpy.random.default_rng() + e = rng.integers(-128, 128 + 1, size=shape, dtype=float) + h = rng.integers(-128, 128 + 1, size=shape, dtype=float) self.es = [e] self.hs = [h] self.ss = []