Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1821 +/- ##
==========================================
+ Coverage 86.84% 86.91% +0.06%
==========================================
Files 436 437 +1
Lines 57952 58014 +62
Branches 5460 5469 +9
==========================================
+ Hits 50330 50421 +91
+ Misses 6186 6158 -28
+ Partials 1436 1435 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1654.
getJcurrently assumes the active-cell projection exists even whenstoreJ=False, then calls the removed receiver methodprojGLoc. This uses all mesh cells for the matrix-free case and obtains the receiver projection grid from the fields, consistently with receiver evaluation. Stored sensitivities keep their existing active-cell restriction.The regression tests cover both 3D formulations, pole and dipole receivers, and default/full/subset active-cell arguments. They check matrix shape and values against the matrix-free adjoint operation, predictions, and Jacobian-vector products with an eta/taui model.
Validation
On Python 3.12, the 12 new cases reproduce the two reported AttributeErrors before the fix. With the fix, the regression tests and existing 2D/3D SIP tests pass:
pytest -q tests/em/static/test_sip_getj.py tests/em/static/test_sip_survey.py tests/em/static/test_SIP_jvecjtvecadj.py tests/em/static/test_SIP_2D_jvecjtvecadj.py # 32 passed black --check --target-version py312 simpeg/electromagnetics/static/spectral_induced_polarization/simulation.py tests/em/static/test_sip_getj.py ruff check simpeg/electromagnetics/static/spectral_induced_polarization/simulation.py tests/em/static/test_sip_getj.py flake8 simpeg/electromagnetics/static/spectral_induced_polarization/simulation.py tests/em/static/test_sip_getj.pyPR Checklist
Additional information
I used Codex to help investigate and prepare the implementation and regression tests.