Skip to content

Clean up Numba functions for potential field simulations#1663

Merged
santisoler merged 7 commits into
mainfrom
pf-numba-functions
May 15, 2025
Merged

Clean up Numba functions for potential field simulations#1663
santisoler merged 7 commits into
mainfrom
pf-numba-functions

Conversation

@santisoler

@santisoler santisoler commented May 12, 2025

Copy link
Copy Markdown
Member

Summary

Declutter the potential field simulations by defining dictionaries with Numba functions for gravity and magnetics. This way the simulations don't need to define private attributes for each one of them: they can just get the desired function in a single line. Raise NotImplementedError on diagonal of G.T @ G when "forward_only" and using geoana as engine. Specify which type of error should be raised in the xfail parameters present in some tests.

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

What does this implement/fix?

Additional information

Make the gravity simulation to use the dictionary to get the desired
Numba function upon request. This simplifies the simulation code
removing the need to define private attributes for each one of them.
Raise a NotImplementedError on diagonal of G.T @ G when forward_only and
using geoana as engine.
@codecov

codecov Bot commented May 13, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 98.38710% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.19%. Comparing base (255d2fb) to head (b58a7d8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
simpeg/potential_fields/gravity/simulation.py 95.45% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1663      +/-   ##
==========================================
- Coverage   86.20%   86.19%   -0.02%     
==========================================
  Files         416      416              
  Lines       54970    54914      -56     
  Branches     5129     5124       -5     
==========================================
- Hits        47388    47331      -57     
  Misses       6164     6164              
- Partials     1418     1419       +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.

@santisoler
santisoler marked this pull request as ready for review May 14, 2025 16:49
@santisoler
santisoler merged commit 50eeac8 into main May 15, 2025
@santisoler
santisoler deleted the pf-numba-functions branch May 15, 2025 16:27
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.

1 participant