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

[Feature]: Replace image diff checking in integration tests with metrics checking instead #756

Open
tomvothecoder opened this issue Nov 29, 2023 · 1 comment

Comments

@tomvothecoder
Copy link
Collaborator

tomvothecoder commented Nov 29, 2023

Is your feature request related to a problem?

Currently, tests/integration/test_diags.py runs the all_sets.cfg diagnostics and takes the diffs of the results and compares them against a baseline (whatever is on Chrysalis). We set the minimum diff threshold of non-zero pixels to 2%. The issue with taking a diff of two images is that any noise can break the test (e.g., change in matplotlib formatting, shifting of legend, floating point formatting, different font sizes). The baseline results sometimes need to be updated if
matplotlib updates introduce side-effects. It is challenging to debug the integration tests and they take a long time to run (#643), which bogs down development.

For example, below is the actual, expected, and the difference of both. Notice that the diff is basically just noise from the legend shifting over a bit and a change in the "Test" name.

feedback-TREFHT-NINO3-TS-NINO3_actual
feedback-TREFHT-NINO3-TS-NINO3_expected
feedback-TREFHT-NINO3-TS-NINO3_diff

Describe the solution you'd like

We should compare the underlying metrics in the .json files instead. Users should manually validate the plots are as expected based on the metrics being plotted since that is a more reliable over pixel comparisons.

Describe alternatives you've considered

No response

Additional context

No response

@forsyth2
Copy link
Collaborator

Thanks @tomvothecoder I agree this would a more reliable test. I suppose zppy could do the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants