Improving reading and recreating fit pseudodata
Created by: siranipour
Now that python is used to construct the pseudodata, I've updated the pseudodata.py function that regenerates the pseudodata of a given fit. It's now much easier to do this in parallel because we don't use swig objects anymore.
Closes #1323 (closed)
The tests will, however, fail for now until I regenerate a PDF that saves its python pseudodata for the regression test. @wilsonmr, I may be misremembering but did you at some point have a PR which saved the pseudodata of a fit?
EDIT: This has turned into a bit of a general improvements PR.
- Corrected the recreation of a fit pseudodata. I've swapped the C++ make_replica with the python one.
-
Improved the reading of pseudodata from a fit which has
fitting::savepseudodata: True
- There was a function that created the tr_mask for all replicas:
https://github.com/NNPDF/nnpdf/blob/b636ae04e55264efe9075cd7442fc2844293794d/validphys2/src/validphys/n3fit_data.py#L386
I've now changed this so it works on an individual replica and then
collect
ed it overreplicas
(I did this because it was useful for the recreation of a training validation mask. - Fixed the tests