-
Notifications
You must be signed in to change notification settings - Fork 7
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
Very small differences in numerical values when determining correct rows #246
Comments
@siddharth-krishna any chance you could take a look at this one? |
I assume you mean the additional rows in https://github.com/etsap-TIMES/xl2times/actions/runs/11969575511/job/33370600563?pr=240 for commit 5e9db3e The underlying problem is that we convert the produced tables and the ground truth tables to strings before we compare them, so it isn't easy to set a tolerance (e.g. Perhaps it's time to look into this again and see if we can remove |
Well, they are identified both as additional and missing. :-) |
How about doing this in a step-wise manner? Most of the columns are ok to stay strings. We could start with e.g. |
I had another idea for a quicker/step-wise solution: we could print floats as strings to a specific precision in |
An attempted fix for #246, which was first noticed in #240. With some [trial and error](#240 (comment)) I set a precision of `.10g` (10 significant figures in exponential/scientific notation) for floating point numbers. I also had to change the `gdxdiff` options to additionally use a tolerance in relative difference when comparing the output DD files to the ground truth, otherwise the higher precision output above increased the DD diff. We now use `1e-6` for both absolute `Eps` and relative `RelEps` difference tolerance. If I understand correctly how `gdxdiff` [works](https://www.gams.com/latest/docs/T_GDXDIFF.html#GDXDIFF_OPTIONS_CRITERIONEXPLANATION), this feels like a reasonable tolerance: ``` AbsDiff := Abs(V1 - V2); if AbsDiff <= EpsAbsolute then Result := true else if EpsRelative > 0.0 then Result := AbsDiff / (1.0 + DMin(Abs(V1), Abs(V2))) <= EpsRelative else Result := false; ``` Finally, we were reporting the number of lines in the output of `gdxdiff`, but that's only the number of sets/parameters that are different, and doesn't track improvements in number of rows different. I'm now passing the output of `gdxdiff` to `gdxdump` so that the "GDX Diff" column is more accurate and tracks number of rows in the diff.
E.g., there are currently 24 additional / missing values for
PRC_RESID
on Ireland.The text was updated successfully, but these errors were encountered: