From 7833d79d11bf5bd8f31fc4bef1aafeb46c7bbcf0 Mon Sep 17 00:00:00 2001 From: juacrumar Date: Thu, 30 Nov 2023 16:37:39 +0100 Subject: [PATCH] look at ForcePositive during the test --- benchmarks_and_tests/check_many_pdfs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/benchmarks_and_tests/check_many_pdfs.py b/benchmarks_and_tests/check_many_pdfs.py index 4f1822a..abe7fa4 100644 --- a/benchmarks_and_tests/check_many_pdfs.py +++ b/benchmarks_and_tests/check_many_pdfs.py @@ -43,6 +43,10 @@ def _compare_w_lhapdf(pdf, npoints=1000, tolerance=1e-6): lres = np.array(lhapdf_results) pres = pdfflow_pdf.py_xfxQ2_allpid(xx, qq).numpy() + # This is not still implemented as part of pdfflow, but need to be careful during the check + if pdf.info.get("ForcePositive", 0) > 0: + pres = np.maximum(pres, 1e-10) + np.testing.assert_allclose(pres, lres, rtol=tolerance, atol=tolerance)