Proposed changes to the behaviour of the PDF class.
Created by: scarlehoff
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: the nnpdf_error attribute -
Loaded PDF class -
PDF .info file -
Closure test references
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.
https://github.com/NNPDF/nnpdf/blob/eeae19b15c960b4f8f974c3ac2ba2af36ed845bc/validphys2/src/validphys/core.py#L101 https://github.com/NNPDF/nnpdf/blob/eeae19b15c960b4f8f974c3ac2ba2af36ed845bc/validphys2/src/validphys/core.py#L149
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:
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.