def check_scatter_sq(value): """ Check two processor, algorithm pairs against each other for SQ calculation :param value: :return: """ # set everything up atoms, exp = value[:2] scat = ElasticScatter(exp_dict=exp, verbose=True) proc1, alg1 = value[-1][0] proc2, alg2 = value[-1][1] # run algorithm 1 scat.set_processor(proc1, alg1) ans1 = scat.get_sq(atoms) # run algorithm 2 scat.set_processor(proc2, alg2) ans2 = scat.get_sq(atoms) # test stats_check(ans1, ans2, rtol, atol) assert_allclose(ans1, ans2, rtol=rtol, atol=atol) # make certain we did not give back the same pointer assert ans1 is not ans2
def check_scatter_consistancy(value): atoms, exp = value[0:2] proc, alg = value[-1] scat = ElasticScatter(exp_dict=exp, verbose=True) scat.set_processor(proc, alg) ans = scat.get_pdf(atoms) ans1 = scat.get_fq(atoms) print(len(ans1)) print(scat.get_scatter_vector().shape) ans2 = scat.get_sq(atoms) print(len(ans2)) ans3 = scat.get_iq(atoms)
def check_scatter_sq(value): """ Smoke test for SQ :param value: :return: """ atoms, exp = value[0:2] proc, alg = value[-1] scat = ElasticScatter(exp_dict=exp, verbose=True) scat.set_processor(proc, alg) # Test a set of different sized ensembles ans = scat.get_sq(atoms) # Check that Scatter gave back something assert ans is not None # Check that all the values are not zero assert np.any(ans) del atoms, exp, proc, alg, scat, ans return