diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 03cb440bca..9d1b6376e3 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -36,7 +36,7 @@ requirements: - requests - prompt_toolkit - validobj - - pineappl >=0.7.3 + - pineappl >=0.8.2 - eko >=0.14.2 - fiatlux - sphinx >=5.0.2,<6 # documentation. Needs pinning temporarily due to markdown diff --git a/pyproject.toml b/pyproject.toml index 970d3d5b1b..cb3809b892 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ vp-deltachi2 = "validphys.scripts.vp_deltachi2:main" # Generic dependencies (i.e., validphys) python = "^3.9" matplotlib = ">=3.3.0,<3.8" -pineappl = "^0.7.0" +pineappl = "^0.8.2" pandas = "*" numpy = "*" validobj = "*" diff --git a/validphys2/examples/API_extension_Pineappl.ipynb b/validphys2/examples/API_extension_Pineappl.ipynb index 813f6ca204..90d6afdc73 100644 --- a/validphys2/examples/API_extension_Pineappl.ipynb +++ b/validphys2/examples/API_extension_Pineappl.ipynb @@ -85,7 +85,7 @@ " bin_norm = self._grid.bin_normalizations().reshape(-1, 1)\n", " \n", " for i, member in enumerate(pdf.members):\n", - " tmp = self._grid.convolute_with_one(2212, member.xfxQ2, member.alphasQ2, xi=all_scales).reshape(-1, len(all_scales))\n", + " tmp = self._grid.convolve_with_one(2212, member.xfxQ2, member.alphasQ2, xi=all_scales).reshape(-1, len(all_scales))\n", "\n", " if self._apply_bin:\n", " tmp *= bin_norm\n", diff --git a/validphys2/src/validphys/photon/structure_functions.py b/validphys2/src/validphys/photon/structure_functions.py index 31cae6c083..73b45f4746 100644 --- a/validphys2/src/validphys/photon/structure_functions.py +++ b/validphys2/src/validphys/photon/structure_functions.py @@ -43,7 +43,7 @@ def __init__(self, path_to_fktable, pdfs): self.q2_max = max(q2) - predictions = self.fktable.convolute_with_one(2212, pdfs.xfxQ2) + predictions = self.fktable.convolve_with_one(2212, pdfs.xfxQ2) grid2D = predictions.reshape(len(x), len(q2)) self.interpolator = RectBivariateSpline(x, q2, grid2D) diff --git a/validphys2/src/validphys/pineparser.py b/validphys2/src/validphys/pineparser.py index b58dc947c6..f61d9aa3ab 100644 --- a/validphys2/src/validphys/pineparser.py +++ b/validphys2/src/validphys/pineparser.py @@ -159,9 +159,16 @@ def pineappl_reader(fkspec): is_polarized = pine_rep.key_values().get("polarized") == "True" # Is it hadronic? (at the moment only hadronic and DIS are considered) - hadronic = pine_rep.key_values()["initial_state_1"] == pine_rep.key_values()["initial_state_2"] + try: + parton1 = pine_rep.key_values()["convolution_particle_1"] + parton2 = pine_rep.key_values()["convolution_particle_2"] + except KeyError: + parton1 = pine_rep.key_values()["initial_state_1"] + parton2 = pine_rep.key_values()["initial_state_2"] + hadronic = parton1 == parton2 + # Sanity check (in case at some point we start fitting things that are not protons) - if hadronic and pine_rep.key_values()["initial_state_1"] != "2212": + if hadronic and parton1 != "2212": raise ValueError( "pineappl_reader is not prepared to read a hadronic fktable with no protons!" ) @@ -223,7 +230,7 @@ def pineappl_reader(fkspec): # Create the multi-index for the dataframe # for optimized pineappls different grids can potentially have different indices # so they need to be indexed separately and then concatenated only at the end - lumi_columns = _pinelumi_to_columns(p.lumi(), hadronic) + lumi_columns = _pinelumi_to_columns(p.channels(), hadronic) lf = len(lumi_columns) data_idx = np.arange(ndata, ndata + n) if hadronic: diff --git a/validphys2/src/validphys/tests/photon/test_structurefunctions.py b/validphys2/src/validphys/tests/photon/test_structurefunctions.py index 5ed71272a8..f3bba28d0d 100644 --- a/validphys2/src/validphys/tests/photon/test_structurefunctions.py +++ b/validphys2/src/validphys/tests/photon/test_structurefunctions.py @@ -35,7 +35,7 @@ def bin_left(self, i): else: return 0 - def convolute_with_one(self, pdgid, xfxQ2): + def convolve_with_one(self, pdgid, xfxQ2): return np.zeros((10, 10)) @@ -99,7 +99,7 @@ def test_interpolation_grid(): fktable = pineappl.fk_table.FkTable.read(path_to_fktable) x = np.unique(fktable.bin_left(1)) q2 = np.unique(fktable.bin_left(0)) - predictions = fktable.convolute_with_one(2212, pdfs.members[replica].xfxQ2) + predictions = fktable.convolve_with_one(2212, pdfs.members[replica].xfxQ2) grid2D = predictions.reshape(len(x), len(q2)) struct_func = sf.InterpStructureFunction(path_to_fktable, pdfs.members[replica])