NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
12 stars 3 forks source link

Complete the Fortran interface and extend the Python interface #256

Closed janw20 closed 4 months ago

janw20 commented 5 months ago

Hi, I was working on using PineAPPL with an existing Fortran code, and during that, I completed the Fortran interface to the PineAPPL C API, wrote a file to test this and added an example how to use the interface with LHAPDF, and also I implemented the convolute_with_two function in the Python interface.

cschwan commented 5 months ago

Hi @janw20, thank you for your pull request! I had a look at your changes and they look pretty much as they should. I will comment on a few minor details, but after fixing them we can merge the PR quite soon.

cschwan commented 5 months ago

We probably also want to improve the following points (not necessarily in this PR):

janw20 commented 4 months ago

Hi @cschwan, thanks for your comments, I added the terminating newlines. I started learning Rust but I'm not very proficient yet, so I don't know if I can contribute to how the Fortran module would be compiled with cargo-c. But I think it would be nice if it would be installed together with the C API.

alecandido commented 4 months ago

@cschwan is certainly more expert than myself (he did it) but, ttbomu,the only two things you should be concerned about for C installation are:

https://github.com/NNPDF/pineappl/blob/11cc43d2f54e0046688210a004dedcab26fc5958/pineappl_capi/Cargo.toml#L25-L26 and https://github.com/NNPDF/pineappl/blob/master/pineappl_capi/cbindgen.toml

They are both declarative and pretty much straightforward.

For Fortran I guess there are additional problems, not related to Rust or cargo-c, but to Fortran itself. Most likely, the discussion pointed out by @cschwan is a great starting point (and my guess is that the main issue is the portability of the possible alternatives...)

cschwan commented 4 months ago

No worries, @janw20, my comment above was more about writing down the ideas so they don't get lost. I created dedicated Issues for them now: #257 and #258.

cschwan commented 4 months ago

This looks good and I'm merging it now. Thanks again, @janw20!