This is a collection of issues with the current implementation of the PDF class.
This issue will be organized as:
- Problem
- Examples
- Solution
Todo:
Error Type
Half of the issues with the PDF class is the management of the error type.
The nnpdf_error attribute:
I will remove this attribute and all references to it. If something is accessing this attribute then it is a libNNPDF thing and should be removed. Instead (as was suggested) any behavior that depends on the error type of the PDF should be interfaced through its associated stats_class.
Actual PDF
Currently load loads a libNNPDF PDF set.
It will be changed to a python wrapper to the lhapdf python interface. It makes sense to do it this way because it allows for certain optimization (such as grid_values).
Attributes
Currently we look inside the info file of the PDF by using hasattr, which is confusing and hides what's actually happening.
|
def __getattr__(self, attr): |
|
if hasattr(self, "ErrorConfLevel"): |
I will change it to something more explicit.
Reference to libNNPDF PDF
There are two instances where the libNNPDF PDF is used, both related to closure tests:
|
def internal_multiclosure_dataset_loader( |
|
loaded_data.MakeClosure(fakeset, fakenoise) |
Of course, some of the issues highlighted here might have reasons behind them to which I'm not privy. I might also be missing other points that could be removed and that I'm overlooking.
EDIT: Change the places in which libNNPDF is necessary.
This is a collection of issues with the current implementation of the PDF class.
This issue will be organized as:
Todo:
Error Type
Half of the issues with the PDF class is the management of the error type.
The
nnpdf_errorattribute:nnpdf/validphys2/src/validphys/core.py
Line 180 in eeae19b
I will remove this attribute and all references to it. If something is accessing this attribute then it is a libNNPDF thing and should be removed. Instead (as was suggested) any behavior that depends on the error type of the PDF should be interfaced through its associated
stats_class.Actual PDF
Currently
loadloads a libNNPDF PDF set.nnpdf/validphys2/src/validphys/core.py
Line 162 in eeae19b
It will be changed to a python wrapper to the
lhapdfpython interface. It makes sense to do it this way because it allows for certain optimization (such asgrid_values).Attributes
Currently we look inside the info file of the PDF by using
hasattr, which is confusing and hides what's actually happening.nnpdf/validphys2/src/validphys/core.py
Line 101 in eeae19b
nnpdf/validphys2/src/validphys/core.py
Line 149 in eeae19b
I will change it to something more explicit.
Reference to libNNPDF PDF
There are two instances where the libNNPDF PDF is used, both related to closure tests:
nnpdf/validphys2/src/validphys/closuretest/multiclosure.py
Line 36 in d68954e
nnpdf/validphys2/src/validphys/filters.py
Line 180 in eeae19b
Of course, some of the issues highlighted here might have reasons behind them to which I'm not privy. I might also be missing other points that could be removed and that I'm overlooking.
EDIT: Change the places in which libNNPDF is necessary.