Skip to content
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

JSON diff has unreasonable threshold for big diff #70

Open
jmarrec opened this issue Jun 21, 2021 · 0 comments
Open

JSON diff has unreasonable threshold for big diff #70

jmarrec opened this issue Jun 21, 2021 · 0 comments

Comments

@jmarrec
Copy link
Contributor

jmarrec commented Jun 21, 2021

As stated on NREL/EnergyPlus#8833 (comment)

The json big diffs: I think the epregression script is unreasonable:

for col_num in range(num_values):
num_values_checked += 1
value_1 = this_row_data_1[col_num]
value_2 = this_row_data_2[col_num]
if not value_1 == value_2:
f_1 = float(value_1)
f_2 = float(value_2)
if abs(f_1 - f_2) > 0.00001:
resulting_diff_type = 'Big Diffs'
num_big_diffs += 1
else:
if 'Big' not in resulting_diff_type:
resulting_diff_type = 'Small Diffs'
num_small_diffs += 1

It assumes an absolute difference > 0.0001 is a big diff. This for eg:

image

It's categorized as a big diff, but in fact it's a 1e-12 difference in %...

In [1]: f_1 = 30310597.103115804

In [2]: f_2 = 30310597.102913737

In [3]: abs(f_1 - f_2) > 0.00001
Out[6]: True

In [7]: (f_1 - f_2) / f_1
Out[7]: 6.6665528125937005e-12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant