def check_scatter_grad_pdf(value): """ Check two processor, algorithm pairs against each other for gradient PDF 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_grad_pdf(atoms) # run algorithm 2 scat.set_processor(proc2, alg2) ans2 = scat.get_grad_pdf(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_grad_pdf(value): """ Smoke test for grad PDF :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_grad_pdf(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