Only require necessary info in runcards#973
Conversation
|
@scarlehoff Maybe it would be useful if you could list the parameters that you think the code requires you to have in the runcard but that n3fit does not actually require, so that we can look at editing the checks? |
|
Seems reasonable enough to me. I think there are some cases in code which possibly need to be updated to not assume that key exists: I think some of the Also the |
|
The |
Good points! |
Okay, as a first thing vp-setupfit seems to run fine when I remove all of these. I guess you're concerned that if these are removed from the runcard something else breaks further down the line, e.g. some vp actions that are needed in processing/analysing the fit after it's been run? |
|
To be honest I don't remember if I didn't remove them because something broke a long time ago or whether I was just afraid to do so. |
|
@wilsonmr The check order on a given action is deterministic and is inner to outer, I believe. |
…closuretest namespace is always there
What does this mean for what we should do here? Don't the following checks mean we're okay? https://github.com/NNPDF/nnpdf/blob/master/validphys2/src/validphys/closuretest/closure_checks.py#L24 and https://github.com/NNPDF/nnpdf/blob/master/validphys2/src/validphys/closuretest/closure_checks.py#L52. I've probably just not fully understood |
|
can I get back to you on that? I need to check in more detail |
|
@wilsonmr Yep, of course, there's no rush! |
Yep, I understand. From having a (quick) look at where those three things appear in the code I didn't see anything that would obviously break when getting rid of them, but someone else should check too. Just to be sure, n3fit doesn't care about these two lines, does it? |
|
Hi @voisey in I'm not sure why in I think that the I think that in Are you happy to look into this? I don't think it's too much work - just refining some checks and rearranging the order in which they are executed mainly. If not I can take a look at some point |
|
Thanks for looking into this @wilsonmr. I'm happy to look at doing the things you mention. I'm not sure when but it's on my to do list |
|
I guess this isn't a blocker for anything |
|
@wilsonmr I'd like to check something with you regarding what you say about moving checks further in. For example, if I run where I suppose the error comes from the production rule here: https://github.com/NNPDF/nnpdf/blob/master/validphys2/src/validphys/config.py#L269. Now I suppose what you're saying is that I should move |
By this I meant that the production rule raising the error is fine (still happens at production time and the error explains pretty clearly what has happened) however you are welcome to write more in the error message if you think it wouldn't be clear to a user why this has happened (I suppose it doesn't say why we want closuretest namespace) I don't think any moving of the checks could remedy this because the checks look at the arguments of the action (but the resources are clearly resolved at that point because e.g I was worried about potential cases where there was no dependency on the underlying law production rule but checks which assumed that there was a So actually the only thing to worry about is probably in |
|
@wilsonmr I'm trying to call but this doesn't work in that the check isn't executed and the code just runs. Do you know what I'm doing wrong here? Probably something silly |
|
oh yeah @Zaharid showed me something like this before. The decorator means the check can't be called directly. Instead try see #977 (comment) for a more intelligent explanation |
|
Great, that works now, thanks! |
|
@wilsonmr I've gone through closure_results and multiclosure and with 31be492 I think I've taken care of the relevant cases, but please tell me what you think. Regarding multiclosure_pdf, you said that you thoughts things were okay there, since the |
|
@wilsonmr Do you have any thoughts on the above? |
|
Sorry for ignoring you, my github notifications were going straight to spam for a while. So I think those funcitons are ok because they're technically nit unique to closure tests. So I think we can leave them! A covmat is a covmat after all.. |
|
No problem! Ah of course, I hadn't thought of that! At this point I think it could be good to produce a fit with all of these pieces removed (closuretest, seed, rnalgo, stopping) to check that nothing breaks, do you agree @wilsonmr? If so, would it be cheeky to remove these from n3fit/runcards/developing.yml on this branch, get the fit bot to run it and then remove the commit? |
|
Actually, if the bot were successful I suppose we may want to keep the changes to the runcard so that it's as simple as possible, so the last point could be scrapped |
I was about to say this |
|
I'll double check the closure stuff by running a few reports but it looks good to me |
|
I can also remove several other things from developing.yml I think, namely |
|
Sounds good, thanks @wilsonmr! |
|
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
|
Hmm starting to think we should actually update the fit the bot compares to instead of having to dig out #1019 everytime to check nothing was changed |
|
That certainly seems like the safer thing to do. In any case, this shows that nothing breaks in the fit or in comparefits when removing this stuff from the runcard. At this point, are you happy for me to go through the default runcards and remove all of this info @scarlehoff @wilsonmr? |
|
Yes, please do. wrt the bot, we have #1025, but in the meantime I agree, it makes sense to update the current baseline. |
|
If the fit bot tag is attached to a PR does it run with every commit? I've removed it here just to be sure |
|
No, it should only run when tagged (and to run it again you have to untag-tag) |
|
Okay, good to know, thanks! |
|
I've just removed the unnecessary fields from the runcards in the n3fit/runcards folders. Can a couple of people please review this now? I think it would be good to have this merged before the 4.0 baseline is run and to make sure we're careful to remove these fields from the 4.0 runcards to avoid unnecessary info being propagated to all future 4.0 variants |
| f"The `fakedata` key does not exist in the `closuretest` namespace of {fit}'s runcard. " | ||
| f"{fit} is therefore not suitable for closure-test studies." | ||
| ) | ||
| if not fitinfo["closuretest"]["fakedata"]: |
There was a problem hiding this comment.
Ok, maybe it is not related specifically to this PR but what's the point of having a key that is mandatory and that is only allowed to be set to true?
There was a problem hiding this comment.
because it essentially is checking that somebody didn't give a normal fit but try to calc a closure estimator. Because otherwise it could fail silently since - up until this PR - all fits have had a fakepdf which does absolutely nothing.
There was a problem hiding this comment.
As the name of the check suggests
One step towards closing #536.
So far this just removes the requirement for
closuretestandfakedatato be specified in a runcard when running vp-setupfit. I can imagine there being a reason for what I've done being suboptimal, but I thought I'd just open it to the floor anyway so that you can just tell me 😄