Skip to content

Use semantically correct bool comparison for some metrics field tests#948

Merged
msimberg merged 2 commits intoC2SM:mainfrom
msimberg:metrics-bool-fields
Nov 18, 2025
Merged

Use semantically correct bool comparison for some metrics field tests#948
msimberg merged 2 commits intoC2SM:mainfrom
msimberg:metrics-bool-fields

Conversation

@msimberg
Copy link
Copy Markdown
Contributor

@msimberg msimberg commented Nov 17, 2025

Just extracts a minor inconsistency from #853. Also fixes dtype for mask_hdiff.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates comparison assertions in two test functions to use exact equality checks instead of the dallclose helper function, with the intent of making these comparisons semantically correct for boolean fields.

  • Changed assertions from dallclose to (field == field).all() for two mask fields
  • Applied to MASK_PROG_HALO_C in test_factory_mask_bdy_prog_halo_c
  • Applied to MASK_HDIFF in test_factory_compute_diffusion_mask_and_coef

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@msimberg msimberg marked this pull request as draft November 18, 2025 10:21
@msimberg
Copy link
Copy Markdown
Contributor Author

cscs-ci run default

@msimberg msimberg marked this pull request as ready for review November 18, 2025 10:40
@msimberg msimberg force-pushed the metrics-bool-fields branch from 0acd8b3 to 2b5ab00 Compare November 18, 2025 10:42
@github-actions
Copy link
Copy Markdown

Mandatory Tests

Please make sure you run these tests via comment before you merge!

  • cscs-ci run default

Optional Tests

To run benchmarks you can use:

  • cscs-ci run benchmark-bencher

To run tests and benchmarks with the DaCe backend you can use:

  • cscs-ci run dace

To run test levels ignored by the default test suite (mostly simple datatest for static fields computations) you can use:

  • cscs-ci run extra

For more detailed information please look at CI in the EXCLAIM universe.

@msimberg
Copy link
Copy Markdown
Contributor Author

cscs-ci run default

@msimberg msimberg merged commit 941a722 into C2SM:main Nov 18, 2025
47 checks passed
@msimberg msimberg deleted the metrics-bool-fields branch November 18, 2025 18:35
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

Successfully merging this pull request may close these issues.

3 participants