covmat-by-reference-bug#2463
Conversation
|
Hi @jacoterh, thanks for opening this PR. I'll have a look asap! |
achiefa
left a comment
There was a problem hiding this comment.
It looks good to me. I just want to hear whether @scarlehoff has something to say on this matter.
| """ | ||
| for i in range(len(list_of_matrices)): | ||
| list_of_matrices[i] = np.array(list_of_matrices[i]) | ||
| matrices = [np.array(matrix) for matrix in list_of_matrices] |
There was a problem hiding this comment.
I'm OK with this. I just want to check if this affects any of the datasets. regenerate_commondata should tell us if there's any difference.
| assert ld.ndata == 1 | ||
| ld.systematic_errors(t0_predictions) | ||
|
|
||
|
|
There was a problem hiding this comment.
The test is fine per se, but I'd like to hear @scarlehoff's opinion. In my view, the test prevents us from repeating the same mistake, although now that we are aware of the issue it might seem a bit superfluous. Still, I think we should keep it as a reminder for the future and as a signal for new members.
There was a problem hiding this comment.
Many of our tests are built on the blood of our previous mistakes. I'm happy with superflous tests.
|
Why do we get a failing test because of some eko incompatibility? |
|
It looks like the macos workers in github have changed (and have python 3.14 now? we should not be testing that) |
|
Does this mean that we can merge this? Is it possible to change the Python version un the MacOS runners? |
|
No, it means that we need to look over the github docs to understand what changed (or what are we doing wrong in the workflow for mac os) |
| shell: bash -l {0} | ||
| run: | | ||
| conda -n base install conda-build --yes | ||
| conda install -n base conda-build --yes |
There was a problem hiding this comment.
If I was both clever and handsome I would be too powerful for this world.
Anyway, this can be merged I guess.
(I've done this change because reading https://github.com/conda-incubator/setup-miniconda#important I thought macos, which has its own flavour of bash due to licence issues, might be messing with the environment activation, but I don't fully know why this fixes it other than "apple bad")
|
Somehow I'm not authorised to merge? I see "Merging is blocked. You're not authorised to push to this branch". Weird. |
|
I wanted to put strong protections to master. Perhaps I exaggerated :__ I'll double check |
This PR addresses a bug in the construction of the total covariance matrix entering the fit:
nnpdf/validphys2/src/validphys/covmats.py
Lines 479 to 487 in 44a5ddf
The line
nnpdf/validphys2/src/validphys/covmats.py
Line 485 in 44a5ddf
links
covmattodataset_inputs_t0_exp_covmatby reference, i.e. creates an alias, such that any subsequent changes tocovmatalso mutate the original objectdataset_inputs_t0_exp_covmat.dataset_inputs_t0_total_covmattwice before starting the fit, which means thatdataset_inputs_t0_exp_covmatalready includes the theory covmat after the first call such that the returned object that enters the fit after the second call is the experimental covmat plus twice the theory covmat.covmats.pyin 3 other places. This PR fixes this too. It also added a dedicated test to check whether things are safe now.Report comparing the impact of the bug before and after the fix: https://vp.nnpdf.science/Gx02F1SqSaKSvTtOLhXFZg==/