-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use python convolutions also for positivity predictions #1510
Conversation
Could we make positivity be more like datasets without data instead? AFAICT a minimal step would be just declaring that they have OP=NULL and empty cuts for the moment, which would achieve a similar effect. |
The problem is the cuts (and that they don't have |
Can we make the cuts empty? |
If #1506 goes through the same trick can be used here, yes (or whatever trick is used there after review) |
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
d033d2f
to
833ee76
Compare
if len(self.fkspecs) > 1: | ||
# The signature of the function does not accept operations either | ||
# so more than one fktable cannot be utilized | ||
raise ValueError("Positivity datasets can only contain one fktable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why. But it seems to be the case (it is even called fkspec
instead of fkspecs
for positivity)
It was actually quite easy to make the Positivity behave as a normal Dataset, the only actual problems were due to things like This allows for the removal of some of the specific functions for positivity (that were not used anywhere) since the generic ones can be used as well. One can go even a step forward and allow for operations on positivity but I haven't entered there. |
Thinking in terms of #1500, a positivity should have everything that a theory prediction has (i.e. OP, a list of fktables) plus everything commondata has except for the actual data (same metadata, kinematics). cc @enocera For now, it seems like a good idea to make it inherit from DatasetSpec as done here. But I'd get rid of the various gratuitous differences such as allowing only one fkspec, as these don't buy us very much. |
Sadly those come from libNNPDF, but I agree, there should be no difference other than the actual data. |
But isn't the whole point of the exercise that we don't care any more? |
Yes, we remove the things where libNNPDF is used little by little until it can be completely extirpated. But right now this ends whenever we have a libNNPDF class for which we have no substitute and, for positivity, that class happens to like single fktables: nnpdf/validphys2/src/validphys/core.py Line 563 in ab7f053
The same is true for the actual data, of course, but that accepts an fkset instead: nnpdf/validphys2/src/validphys/core.py Line 501 in ab7f053
which is some combination of fktables: nnpdf/validphys2/src/validphys/core.py Line 499 in ab7f053
(also coming from Eventually both |
But why do we need to call the cpp class from python anymore? We don't have many whaky uses of it and seems to me it can be all replaced in one PR. |
Do we even load it anywhere but here?
|
I don't know, but I'd rather wait until we have a substitute for the DataSet to create a PositivitySet that inherits from it rather than doing the PositivityOne first... |
We can of course do it in two time, but seems to me having to change the interface negates many benefits of that. OTOH having a fully python positivity might help surface issues with the pure python approach. |
Given that I broke completely positivity in #1504 and nothing broke until I looked at the comparefits I very much doubt that we'll see anything surface... |
I think that can be used as argument either way :) But as said I'd favor forgetting about loading positivity sets via libnnpdf in vp, so we are more free to design the interface we like, in particular removing a couple of constraints from the current pr. |
I don't see how. Anyway, we do load positivity apparently exactly like we do with the datasets and given that they should be basically the same thing they probably should be changed at the same time: https://github.com/NNPDF/nnpdf/blob/master/validphys2/src/validphys/n3fit_data_utils.py and I would strongly prefer to do the datasets, which are the more general object, first. Otherwise I will be creating some |
Anyway, given that this one depends on #1506 we should finish that before we discuss on how to improve what's not yet done here x) |
I should stop solving conflicts with the github editor because I do more harm than good... |
924014d
to
98ffcbd
Compare
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
As discussed I get the impression that the forced c++ compatibility can be dealt away swiftly, in a different PR. I think that should be done before the new commondata format is introduced as that should not be a prerequisite for any other work. But what is in here should be fine for now. |
For this I had to introduce a new attribute and an
if
condition in the predictions module. Another option is to create a fake op and fake cuts in the positivity spec class I guess.The first commit includes only the
if
condition and the extra attribute to create a record of the cpp and the python version giving the same result, I'll push the change to PositivityResult later if that passes.