def test_randomize_ions(self): fn = os.path.join(cpptraj_test_dir, 'Test_RandomizeIons', 'adh206.tip3p.rst7.gz') tn = os.path.join(cpptraj_test_dir, 'Test_RandomizeIons', 'adh206.ff10.tip3p.parm7.gz') saved_traj_name = os.path.join(cpptraj_test_dir, 'Test_RandomizeIons', 'random.crd.save') traj = pt.iterload(fn, tn) traj_mut = traj[:] saved_traj = pt.iterload(saved_traj_name, traj.top) pt.randomize_ions(traj_mut, mask='@Na+', around=':1-16', by=5.0, overlap=3.0, seed=113698) aa_eq(traj_mut.xyz, saved_traj.xyz, decimal=2)
def test_randomize_ions(self): fn = os.path.join(cpptraj_test_dir, 'Test_RandomizeIons', 'adh206.tip3p.rst7.gz') tn = os.path.join(cpptraj_test_dir, 'Test_RandomizeIons', 'adh206.ff10.tip3p.parm7.gz') saved_traj_name = os.path.join(cpptraj_test_dir, 'Test_RandomizeIons', 'around.overlap.rst7.save') # Set default RNG back to Marsaglia pt.set_default_rng(0) traj = pt.iterload(fn, tn) traj_mut = traj[:] saved_traj = pt.iterload(saved_traj_name, traj.top) pt.randomize_ions(traj_mut, mask='@Na+', around=':1-16', by=5.0, overlap=3.0, seed=1) aa_eq(traj_mut.xyz, saved_traj.xyz, decimal=2)