diff --git a/test/sascalculator/utest_sas_gen.py b/test/sascalculator/utest_sas_gen.py index aa766a108a..a4af19ecf9 100644 --- a/test/sascalculator/utest_sas_gen.py +++ b/test/sascalculator/utest_sas_gen.py @@ -228,6 +228,8 @@ def test_debye_impl(self): from sas.sascalc.calculator.ausaxs import sasview_sans_debye from sas.sascalc.calculator.ausaxs import ausaxs_sans_debye + rng = np.random.default_rng(1984) + from sas.sascalc.calculator.ausaxs.architecture import get_os, OS if get_os() is OS.MAC: self.assertTrue(True, "AUSAXS library is currently not available for MacOS. Skipping test.") @@ -241,14 +243,12 @@ def test_debye_impl(self): import glob pdb_files = glob.glob(os.path.join(os.path.dirname(__file__), 'data/debye_test_files', '*.pdb')) - np.random.seed(1984) - for pdb_file in pdb_files: # load pdb file f = self.pdbloader.read(pdb_file) coords = np.vstack([f.pos_x, f.pos_y, f.pos_z]) q = np.linspace(0.001, 1, 100) - w = np.random.rand(coords.shape[1]) # random weights + w = rng.random(coords.shape[1]) # random weights analytical = sasview_sans_debye.sasview_sans_debye(q, coords, w) external = ausaxs_sans_debye.evaluate_sans_debye(q, coords, w) @@ -266,7 +266,7 @@ def test_debye_impl(self): f = self.pdbloader.read(os.path.join(os.path.dirname(__file__), "data/debye_test_files/SASDPP4.pdb")) coords = np.vstack([f.pos_x, f.pos_y, f.pos_z]) q = np.linspace(0.1, 10, 100) - w = np.random.rand(coords.shape[1]) # random weights + w = rng.random(coords.shape[1]) # random weights analytical = sasview_sans_debye.sasview_sans_debye(q, coords, w) external = ausaxs_sans_debye.evaluate_sans_debye(q, coords, w)