Open cschwan opened 1 year ago
@AleCandido @scarlehoff you can add more backends now. To do that copy the file partons/src/noop.rs
, give it a different name and fill the methods with meaningful implementations. Finally you'll need to add the corresponding lines in partons/src/frontend.rs
here:
and here
The functions PdfSet::new
and PdfSetEnum::new
should then select between the different backends depending on the selected set or PDF (still TBD).
Given the interest, I will soon restart working on automatic fetching and caching.
I was about to propose you the noop.rs
as well, and to move there the former fake_lhapdf.hpp
. But I see you don't need any suggestion :D
Thanks for this part, it looks perfect to me :)
I'm a little bit unhappy about partons/src/fake_lhapdf.rs
, which is a copy of noop.rs
and nothing else, but it's necessary because every struct
implementing Pdf
or PdfSet
must be a different type; I can live with it.
We should decide how the backend selection works, which right now is very dumb for Pdf
and PdfSet
:
One easy way would be to
LHAPDF:NNPDF40_nnlo_as_01180
would load NNPDF4.0 using LHAPDF and PARTONS:NNPDF40_nnlo_as_01180
would use our internal backend, andAnother option is to have different backends name PDF sets differently, but I don't like it that much.
use the 'default' backend if the prefix is missing. This could be our internal backend.
Apply a default is perfectly fine. To select the others, I would pass an optional argument, i.e. Option<BackendsEnum>
in Rust (in Python it can really be optional).
Since I already added a configuration file, we can add an option also there to select a different backend. But I would do at a later stage.
Commit c5f4b29a3da816cb7d534352f66d6e84afb98d81 adds a minimal API, as outlined in #12, which I copied from the lhapdf crate. There are a few things to do: