File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import pytest
22import numpy as np
3+ import os
4+ from pathlib import Path
35
46from itertools import product
57from neopdf .pdf import ForcePositive
@@ -146,6 +148,27 @@ def test_mkpdf_lhaid_member_offset(self, neo_pdfs):
146148 )
147149
148150
151+ class TestLoadFromFile :
152+ def test_mkpdf_lhapdf_by_file (self ):
153+ from neopdf .pdf import PDF
154+
155+ neopdf_data_path = os .environ .get ("NEOPDF_DATA_PATH" )
156+ if not neopdf_data_path :
157+ pytest .skip ("NEOPDF_DATA_PATH environment variable not set." )
158+
159+ path = Path (neopdf_data_path ).joinpath (
160+ "NNPDF40_nnlo_as_01180/NNPDF40_nnlo_as_01180_0000.dat"
161+ )
162+
163+ if not path .exists ():
164+ pytest .skip (f"Data file not found at { path } " )
165+
166+ pdf = PDF .mkPDF_lhapdf_file (str (path ))
167+
168+ xf = pdf .xfxQ2 (21 , 1e-9 , 1.65 * 1.65 )
169+ np .testing .assert_allclose (xf , 0.14844111 , rtol = 1e-8 )
170+
171+
149172class TestForcePositive :
150173 def test_force_positive (self , neo_pdf ):
151174 neopdf = neo_pdf ("nNNPDF30_nlo_as_0118_A56_Z26" )
You can’t perform that action at this time.
0 commit comments