Closed alecandido closed 3 years ago
@AleCandido We need to replace the use of LagrangeSubgridV2
with another type. I can do the replacement, but I'd like to have an integration test for pineappl_py
. Could you please add one (add a .yaml
file generated by yadism, and the test should just check that the generated grid gives the right predictions)?
@cschwan Huhu, is this what you need? https://github.com/N3PDF/yadism/commit/967d3ec9e443ba917b26635fe2c2222445815eaf please tell us if you can run it!
@felixhekhorn How do I install yadmark?
Hi @felixhekhorn and @AleCandido , the FKTable
class is definitely a good idea, and for the time being it's all we need in this direction. Before we merge this branch into master, however, I'd like to make the FKTable
class a Rust struct and then thinly wrap it like any other class - in that regard it stands out from the rest now.
In general, we should come up with a list of rules that guide the design of the Python interface. From what we've done already, I'd say they are:
Before we merge, we should also make sure that
Finally, I propose to rename pineappl_py
to pyneappl
, what do you think?
Starting from the top:
FKTable
object, I understand that is weird to have some features available only through the wrapper, so we can do it (it's a small class at the end)About the guidelines: I believe that's enough, especially because we are aiming for something minimal. Your crate is organized by structs, then in python is easy to mirror by classes. Spare functions would just turn into functions, and even modules are available on both sides (even nested), so it is only required to mirror.
I would remain a little bit flexible on the amount of things that can be done in python, since pyo3
is not always complete or very easy to use sometimes applying some workaround through a little bit more code on the python side is fine as well. Nevertheless: less is more.
About the merge:
yadism
and NNPDF?pyneappl
makes perfect sense, I would say it's quite pythonic. But if we are going to replace @scarrazza ones then I wonder, why not pineappl
itself? (pyneappl
would be more stylish the same, but maybe keeping pineappl
is a more direct choice)
@AleCandido @felixhekhorn The last commit adds the convolute_eko2
method, which is also used in the Python bindings already. If you want to disable the new method simply change eko2
to eko
there. The whole thing compiles, but unfortunately the DIS example from Pineko doesn't work yet - the numbers are simply wrong. I'm not sure if I can debug it today, but if you want to play with it in the meantime, please go ahead!
In any case, I implemented the following:
xir == 1.0
, for xir != 1.0
there a FIXME
in the codeconvolute_eko
:
An update of my last comment:
FIXME
has been fixed in commit 0977653; however, it's not been tested yetx1
and with the PDF at x2
, and LHC processes seem to work. I've tested the ATLAS_DY_7TEV_49FB_HIMASS.pineappl.lz4
grid, which includes NLO QCD+EW corrections. The grid is evolved in about 20 minutes on my computer, previously 4 hours were needed. The critical section is still the one marked in the code (the core of the evolution):Before merging into master we have to fix a few things (ordered by importance):
Grid::convolute
method in the Python part; implemented in commit 9a3153e41e867589814b370b15c6cae4ae277f70FkTable
into the interfacecargo test
problemcreate
c'tors in Python?PyBinRemapper
? Yes, we do: https://github.com/N3PDF/pineappl/pull/51#issuecomment-912437811pub
vs. pub(crate)
in the Rust-Python bridge.gitignore
?@cschwan
change create c'tors in Python?
you were thinking of https://github.com/N3PDF/pineappl/blob/fe5b83989144c4360db156daf7a12134d5ac86c4/pineappl_py/pineappl/grid.py#L23, right? then we can't because we need the c'tor with the raw wrapper object here: https://github.com/N3PDF/pineappl/blob/fe5b83989144c4360db156daf7a12134d5ac86c4/pineappl_py/pineappl/grid.py#L52
do we need PyBinRemapper?
it is still used here: https://github.com/N3PDF/yadism/blob/be995caf3a7f76dafd06336ba83fc570bc31f0a3/src/yadism/output.py#L236 so I guess the answer is yes ... or is there some other way?
add tests add more documentation
actually, where? Rust@pineappl, Rust@pineappl_py, Python@pineappl_py ?
check README
I made a proposal in https://github.com/N3PDF/pineappl/pull/51/commits/e8e18091a72f672212f41ea67559a3b2457156ee - please take a look
add tests add more documentation
actually, where? Rust@pineappl, Rust@pineappl_py, Python@pineappl_py ?
What I'd like to see is tests of the Python interface, so tests written in Python!
Hi @cschwan, I was reading about PyO3, and after a while I started thinking that it may be not so hard to provide bindings for
pineappl
using it.I don't know how much you care, but I decided to make a try, just in my spare time. The goal it's to port a minimal subset of things, just a proof of concept, to expand after to the full one.
It should not take so much, but of course it's not my main business, so it will take its time. Do you mind if I try?
I also thought it was a good way to familiarize a little more with
pineappl
, since soon it will be useful (both because ofyadism
, but also because I am going to work onpineko
too, and I know you are the expert onpineappl
, but it won't hurt to know something more).If you agree maybe you can suggest me which one could be "a minimal set".