Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pineappl version #2129

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.1"
pandas = "*"
numpy = "*"
validobj = "*"
Expand Down
2 changes: 1 addition & 1 deletion validphys2/examples/API_extension_Pineappl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion validphys2/src/validphys/photon/structure_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 10 additions & 3 deletions validphys2/src/validphys/pineparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

cschwan marked this conversation as resolved.
Show resolved Hide resolved
# 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!"
)
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down Expand Up @@ -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])
Expand Down
Loading