Skip to content

GEOPY-2590: Add validator for negative on NDV values in uncertainties#394

Open
domfournier wants to merge 4 commits intorelease/GA_4.8from
GEOPY-2590
Open

GEOPY-2590: Add validator for negative on NDV values in uncertainties#394
domfournier wants to merge 4 commits intorelease/GA_4.8from
GEOPY-2590

Conversation

@domfournier
Copy link
Copy Markdown
Collaborator

@domfournier domfournier commented Apr 29, 2026

GEOPY-2590 - Add validator for negative on NDV values in uncertainties

Copilot AI review requested due to automatic review settings April 29, 2026 19:20
@github-actions github-actions Bot changed the title GEOPY-2590 GEOPY-2590: Add validator for negative on NDV values in uncertainties Apr 29, 2026
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

Adds explicit validation of inversion uncertainty inputs (NaN/NDV and negative values) and corresponding regression tests to ensure invalid uncertainties fail fast with a clear error.

Changes:

  • Add BaseInversionOptions.uncertainties validation that raises GeoAppsError when uncertainties contain NaNs (NDV) or negative values.
  • Add new test_bad_uncertainties cases for Magnetotellurics and Gravity drivers.
  • Adjust MT test data setup to avoid copying newly created uncertainty data entities.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
simpeg_drivers/options.py Adds uncertainty validation + tweaks property-group data retrieval and component data/uncertainty return shape.
tests/run_tests/driver_mt_test.py Adds MT invalid-uncertainty test and adjusts uncertainty creation in synthetic setup.
tests/run_tests/driver_grav_test.py Adds Gravity invalid-uncertainty test (negative uncertainty).

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

Comment thread simpeg_drivers/options.py Outdated
Comment on lines 20 to 21
from geoapps_utils import GeoAppsError
from geoapps_utils.base import Options
Comment thread simpeg_drivers/options.py
Comment thread simpeg_drivers/options.py
Comment thread tests/run_tests/driver_mt_test.py
Comment thread tests/run_tests/driver_mt_test.py Outdated
Comment thread tests/run_tests/driver_grav_test.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.20%. Comparing base (f8dca34) to head (d714bdb).

Additional details and impacted files
@@                Coverage Diff                 @@
##           release/GA_4.8     #394      +/-   ##
==================================================
+ Coverage           90.17%   90.20%   +0.03%     
==================================================
  Files                 129      129              
  Lines                6474     6484      +10     
  Branches              817      820       +3     
==================================================
+ Hits                 5838     5849      +11     
  Misses                422      422              
+ Partials              214      213       -1     
Files with missing lines Coverage Δ
simpeg_drivers/options.py 95.30% <100.00%> (+0.17%) ⬆️

... and 1 file with indirect coverage changes

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

Copy link
Copy Markdown
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

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

looks good!

Comment thread tests/run_tests/driver_mt_test.py
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