Skip to content

Commit

Permalink
Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-wilkins committed Jul 22, 2024
1 parent 480b95c commit 23752d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/sascalculator/utest_sas_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 23752d9

Please sign in to comment.