Skip to content

Improve dipole source tests - #1711

Merged
santisoler merged 4 commits into
mainfrom
improve-some-em-tests
Oct 14, 2025
Merged

Improve dipole source tests#1711
santisoler merged 4 commits into
mainfrom
improve-some-em-tests

Conversation

@santisoler

@santisoler santisoler commented Oct 10, 2025

Copy link
Copy Markdown
Member

Summary

Improve the assertions in dipole source tests for EM. Compute the root mean square of the difference between the numerical and analytic fields in FDEM, and check it's below a certain tolerance. Use np.testing.assert_allclose in TDEM tests to compare the predicted data for both the B and H formulations.

PR Checklist

  • If this is a work in progress PR, set as a Draft PR
  • Linted my code according to the style guides.
  • Added tests to verify changes to the code.
  • Added necessary documentation to any new functions/classes following the
    expect style.
  • Marked as ready for review (if this is was a draft PR), and converted
    to a Pull Request
  • Tagged @simpeg/simpeg-developers when ready for review.

Reference issue

Related to #1709

What does this implement/fix?

Additional information

Compare the root mean square of the difference between the expected and
the actual values of the resulting fields.

Related to #1709
Just to see if the tests passes when we compare them element-wise.
@santisoler
santisoler marked this pull request as draft October 10, 2025 18:46
@codecov

codecov Bot commented Oct 10, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.91%. Comparing base (80be606) to head (2b6f674).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1711      +/-   ##
==========================================
- Coverage   85.91%   85.91%   -0.01%     
==========================================
  Files         418      418              
  Lines       54559    54561       +2     
  Branches     5206     5206              
==========================================
  Hits        46877    46877              
- Misses       6279     6280       +1     
- Partials     1403     1404       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jcapriot jcapriot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These look like they’ll be much more effective as tests.

@lheagy lheagy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, good call. Many thanks @santisoler!!

@santisoler
santisoler marked this pull request as ready for review October 14, 2025 18:48
@santisoler
santisoler merged commit ed40b81 into main Oct 14, 2025
22 checks passed
@santisoler
santisoler deleted the improve-some-em-tests branch October 14, 2025 18:48
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