From cb9ba64bd59a009730fa68307c04238ff05c7be6 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Thu, 26 Sep 2024 10:07:04 -0600 Subject: [PATCH] Add random bound on random sampler. --- architector/io_samplers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/architector/io_samplers.py b/architector/io_samplers.py index 88af311..bd21bb5 100644 --- a/architector/io_samplers.py +++ b/architector/io_samplers.py @@ -326,9 +326,10 @@ def random_sampler(relaxed_mol, n=10, seed=42, min_rmsd=0.1, max_rmsd=0.5, total_out = 0 max_attempts = max_attempts + n count = 0 - max_dist = max_rmsd*0.9 with tqdm(total=n) as pbar: while (total_out < n) and (count < max_attempts): + # Randomize magnitude of displacement + max_dist = max_rmsd*np.random.random() count += 1 out_atoms = relaxed_atoms.copy() # Generate random displacements