-
Notifications
You must be signed in to change notification settings - Fork 12
vp-comparefit issue, due to arclength errors #1681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@comane thanks for this!
This is rather the result of mixing means with quantiles.
Uh. @scarlehoff @RoyStegeman, @enocera could you have a look at this please? |
|
This is not branching from master, is it?
Looking at the blame, the square was removed six years ago. Was it intentional? |
Yes this is a bit odd... I'd still be in favor of doing the correct thing now though, even if we're mainly just comparing relative lengths anyway. We hardly compare this between different reports, especially older ones, so I don't see huge issues arise if we fix it |
|
(Let me tag @scarrazza as well maybe he has some memory of this) |
scarlehoff
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase on the current master so that you get the tests running for python 3.9/3.10.
Also, you will need to update also the regression tests since you changed the form of the arclength.
wrt the np.sqrt, as @RoyStegeman says it doesn't really matter since we never use the actual value but I would prefer if some of the people who was around when that change was made could comment just in case it was actually intentional for some obscure reason.
| ylower = np.abs(yvalues - ylower) | ||
| yupper = np.abs(yupper - yvalues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ylower = np.abs(yvalues - ylower) | |
| yupper = np.abs(yupper - yvalues) | |
| ylower = np.maximum(yvalues - ylower, 0) | |
| yupper = np.maximum(yupper - yvalues, 0) |
I think this is more consistent with what we do in other cases of negative numbers that we don't like (it should not matte much though, it's just a question of taste I guess)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said above, I think the line should be always of length yupper - ylower. We could even remove the point in the middle and be done with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also work for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said above, I think the line should be always of length
yupper - ylower
This is what the modification already does I think.
@Zaharid, @scarlehoff I pushed the rebased version, but it's not running the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was just that github needs a few minutes to reset (and the test failed because of the regression test since the AL has changed).
This is what the modification already does I think.
Maybe I misunderstood @Zaharid but I think what he would like is just to plot ylower-----yupper instead of yvalues +/- (yupper, ywloer) (and now that I write it down I think I agree, we would like to see the spread, we are already removing outliers at postfit so they are not going (should not) to break the plot)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except that yvalues should be something like (yupper - ylower)/2. Otherwise we are back to the original problem.
|
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! Edit by @scarlehoff arclenghts plots for this report and another similar one |
d164a4c to
8cd821d
Compare
| fmt=".", | ||
| fmt='', | ||
| linestyle = '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I am still not completely sure on whether I understood. However, the following modification should do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zaharid we should just remove the plot tests or change the thresholds because they are a nightmare. |
|
The plot tests have been fairly stable for years, and seem to have gotten unstable only lately (due to I guess a bigger update in mpl). Would suggest just dealing with it for now by updating the plots. Let's revisit the issue if this keep happening. |
|
Looks okay to me the way it is now. |
|
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
|
I'm also happy with the new look https://vp.nnpdf.science/L4HDQ463SFK7-nQpiYfrTQ==/#Basespecs0_plot_arc_lengths |
|
@scarlehoff could you see what the current test failure on master is? |
|
Ah, the arclengths changed so the regression of the fit will also see a change of course. And that test is also not run in mac, I forgot about it. |
@Zaharid , @enocera Issue with vp-comparefit due to arclength function.
my guess is that the problem arises from these lines of the code within
validphys.arclength.plot_arc_lengths:yvalues = arclengths.stats.central_value()ylower, yupper = arclengths.stats.errorbar68()ylower = yvalues - yloweryupper = yupper - yvaluesSome of the replicas might be shorter than the central replica. The problem is thus probably fixed by taking the absolute value of the difference.
Another possible issue might be in
validphys.arclength.arc_lengths, namely, inres += integrate.simps(1 + np.square(fdiff), ixgrid[1][1:])It looks like a square root is missing here:
res += integrate.simps(np.sqrt(1 + np.square(fdiff)), ixgrid[1][1:])