- Notifications
You must be signed in to change notification settings - Fork15
Now more carefully nulling out null inputs in epoch_prop.#124
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
esabol commentedMay 16, 2024
Failed tests on PostgreSQL 10 and 11. Compared values are accurate to about 1.0e-8, but then the rest of the digits are different. Any ideas? |
msdemlei commentedMay 17, 2024 via email
On Thu, May 16, 2024 at 02:14:49PM -0700, Ed Sabol wrote: Failed tests on PostgreSQL 10 and 11. Compared values are accurate to about 1.0e-8, but then the rest of the digits are different. Any ideas? The background is that after pg 11, postgres does shortest-preciseformatting of floats, before that, extra_float_digits reallymattered. I had forgotten that 10 and 11 are still tested, and henceremoved the setting from the test case. When I noticed that'strouble, I restored extra_float_digits=2.Why it's still failing is a bit of a mystery. I'll only get to lookinto it next monday or so. If someone beat me to it, that's ofcourse great. |
msdemlei commentedMay 21, 2024 via email
On Fri, May 17, 2024 at 01:01:21PM +0200, msdemlei wrote: The background is that after pg 11, postgres does shortest-precise formatting of floats, before that, extra_float_digits really Ummmm. Perhaps not. I'd appreciate another eye on this after all.What's wrong with pg<12 is something else. Cf.<https://github.com/msdemlei/pgsphere/actions/runs/9112032964/job/25050439651#step:7:61>,where it says in the diff: RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, 20) AS tp;! tp! -------------------------------------------! (4.702747926583129 , 0.08291945093459933) (1 row)So... I don't even know what the bang is supposed to mean as a diffcharacter. diff (1) doesn't say.Can anyone help out? |
esabol commentedMay 21, 2024
@msdemlei wrote:
https://unix.stackexchange.com/questions/325657/what-does-an-exclamation-mark-mean-in-diff-output |
df7cb commentedMay 21, 2024
Luckily, you can soonish forget again what "context" diffs are, pg_regress was switched to "normal" unified diffs in PG12. |
esabol commentedMay 21, 2024
So are the numbers different under PG 10 and 11? If so, why are they different? |
src/epochprop.c Outdated
| retvals[4]=Float8GetDatum(output.pm[1]); | ||
| retvals[5]=Float8GetDatum(output.rv); | ||
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.
Nitpick: Added unnecessary whitespace here.
msdemlei commentedMay 23, 2024 via email
On Wed, May 22, 2024 at 12:49:32PM -0700, Ed Sabol wrote: retvals[4] = Float8GetDatum(output.pm[1]); retvals[5] = Float8GetDatum(output.rv); - + Nitpick: Added unnecessary whitespace here. Hm... I have to admit tabs in empty lines are inconsistent in thissource; there are empty lines that have them and empty lines thatdon't. I give you this inconsistency isn't nice, but for simplicityI'd say we should change to no-whitespace empty lines, because that'ssimpler for the computer to do.I've just pushed that, and I think this PR would be ready for review(and hopefully merging:-). Any takers? Thanks! |
esabol commentedMay 23, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
vitcpp commentedMay 24, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
vitcpp commentedMay 24, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If to set pm_long, pm_lat to NULL, 1.0 accordingly, pm_lat value will be used in calculations as a non-null value. Not sure, how it can affect the result. I would propose to rewrite this code to make the logic more clear. Original code: Proposed code: if (PG_ARGISNULL(2) || PG_ARGISNULL(3)) |
vitcpp commentedMay 24, 2024
Just some thoughts, if parallax is NULL, may be to set RV in output like in input? |
msdemlei commentedMay 24, 2024 via email
On Fri, May 24, 2024 at 05:22:22AM -0700, Vitaly wrote: if (PG_ARGISNULL(2) || PG_ARGISNULL(3)) { ... } else { ... } |
expected/epochprop.out Outdated
| 269.4744079540 | 4.4055337210 || -801.210 | 10361.762 | | ||
| to_char | to_char | to_char| to_char | to_char | to_char | ||
| -----------------+-----------------+----------+----------+------------+---------- | ||
| 269.4744079540 | 4.4055337210 |.000| -801.210 | 10361.762 |-###.### |
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.
Meant to ask before: Is the "-###.###" intentional? If not, it seems to me you should change '999D999' on line 25 to increase the space for the digits to get a real answer.
msdemlei commentedMay 27, 2024 via email
On Fri, May 24, 2024 at 08:52:13AM -0700, Ed Sabol wrote:@esabol commented on this pull request. Meant to ask before: Is the "-###.###" intentional? If not, it seems to me you should change '999D999' on line 25 to increase the space for the digits to get a real answer. Ouch. Thanks for paying attention. This is another reason to pullthrough the input RV: A parallax of 0, and so the -###.### was reallya sign that something was wrong: I shouldn't have made RV copyingconditional on NULL in the parallax input.In commit046a50c, I am now using parallax_valid again to notice whenI should not use the RV coming out of epoch propagation. And thisgives now a sane result here, too. |
vitcpp commentedMay 29, 2024
@msdemlei Could you please rebase the PR? Thank you in advance. |
msdemlei commentedMay 31, 2024 via email
On Wed, May 29, 2024 at 08:17:08AM -0700, Vitaly wrote:@msdemlei Could you please rebase the PR? Thank you in advance. rebased and force-pushed. Thanks for the review! |
vitcpp commentedMay 31, 2024
@esabol Are you ok with the PR? |
esabol commentedMay 31, 2024
vitcpp commentedJun 3, 2024
@msdemlei I'm ready to merge this PR. I would like to propose to squash these commits into the single one. Let me know please if you want to do it. Otherwise, I will do it using github's Squash and Merge. |
This is so we do not invent values for pm, parallax, or rv. Weare actually a bit over-cautious and invalidate both PMs even ifonly one is missing. This is because PMs mix, and hence there are tracesof the invented 0 in the other component of the PM. Similarly,when the parallax is missing or bad, the RV would be heavily contaminated;in these cases, we copy through the original RV, as it may still be usefuland certainly will not be grossly wrong.(sorry about a few whitespace diffs introduced by killing trailing whitespacein sql/epochprop.sql and src/epochprop.c)
msdemlei commentedJun 5, 2024 via email
On Mon, Jun 03, 2024 at 01:45:24AM -0700, Vitaly wrote:@msdemlei I'm ready to merge this PR. I would like to propose to squash these commits into the single one. Let me know please if you want to do it. Otherwise, I will do it using github's Squash and Merge. There's a whitespace-only commit in there, and I tend to prefer tohave them separate, but it's not major, so I'm squashing. Thanks! |


This is so we do not invent values for pm, parallax, or rv. We are actually a bit over-cautious and invalidate both PMs even if only one is missing. This is because PMs mix, and hence there are traces of the invented 0 in the other component of the PM. Similarly, when the parallax is missing, the RV would be heavily contaminated and hence is nulled out.
Sorry about the whitespace diffs introduced by killing trailing whitespace in sql/epochprop.sql; if they are too confusing, I'll take them into a commit of their own.
See alsoivoa-std/udf-catalogue#19, which is about a thin wrapper around epoch_prop.