Skip to content

Commit

Permalink
dont extrapolate in q
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed Nov 30, 2023
1 parent 6a7d996 commit 5ae01b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_many_pdfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check interpolation for many PDFs
on: [push]

jobs:
pdftest:
test_of_pdfs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 4 additions & 3 deletions benchmarks_and_tests/test_many_pdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ def _compare_w_lhapdf(pdf, npoints=1000, tolerance=1e-6):

# Get n points for x between 0 and 1
xx = np.random.rand(npoints)
# And n points for q between 1 and 1e5 GeV
qq = (1.0 + np.random.rand(npoints) * np.sqrt(pdfflow_pdf.q2max)) ** 2
# And n points for q between the min and the maximum seen by pdfflow
qdelta = pdfflow_pdf.q2max - pdfflow_pdf.q2min
qq = pdfflow_pdf.q2min + np.random.rand(npoints) * qdelta

# Make sure the order is the same as in pdfflow
flavors = pdf.info["Flavors"]
Expand All @@ -42,7 +43,7 @@ def _compare_w_lhapdf(pdf, npoints=1000, tolerance=1e-6):
lres = np.array(lhapdf_results)
pres = pdfflow_pdf.py_xfxQ2_allpid(xx, qq).numpy()

np.testing.assert_allclose(pres, lres, rtol=tolerance)
np.testing.assert_allclose(pres, lres, rtol=tolerance, atol=tolerance)


if __name__ == "__main__":
Expand Down

0 comments on commit 5ae01b4

Please sign in to comment.