Skip to content

Filter NaN parameter rows in EnIF update#13202

Draft
larsevj wants to merge 1 commit intoequinor:mainfrom
larsevj:enif_nan_filtering
Draft

Filter NaN parameter rows in EnIF update#13202
larsevj wants to merge 1 commit intoequinor:mainfrom
larsevj:enif_nan_filtering

Conversation

@larsevj
Copy link
Copy Markdown
Collaborator

@larsevj larsevj commented Mar 26, 2026

Surface and field parameters commonly have NaN for inactive grid cells. When EnIF stacks all parameters into a joint matrix, these NaN values corrupt boost_linear_regression (np.argmax treats NaN as maximum) and propagate through StandardScaler, contaminating whichever parameter sits at index 0 in the joint matrix.

Issue
Resolves #my_issue

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Add backport label to latest release (format: 'backport release-branch-name')

Surface and field parameters commonly have NaN for inactive grid cells.
When EnIF stacks all parameters into a joint matrix, these NaN values
corrupt boost_linear_regression (np.argmax treats NaN as maximum) and
propagate through StandardScaler, contaminating whichever parameter
sits at index 0 in the joint matrix.
@larsevj larsevj force-pushed the enif_nan_filtering branch from f6b20ac to a38553e Compare March 26, 2026 15:57
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.24%. Comparing base (58cc8d7) to head (a38553e).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/ert/analysis/_enif_update.py 83.87% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13202      +/-   ##
==========================================
- Coverage   90.26%   90.24%   -0.03%     
==========================================
  Files         453      453              
  Lines       31301    31327      +26     
==========================================
+ Hits        28255    28272      +17     
- Misses       3046     3055       +9     
Flag Coverage Δ
cli-tests 37.43% <48.38%> (+<0.01%) ⬆️
gui-tests 67.38% <48.38%> (-0.04%) ⬇️
performance-and-unit-tests 77.78% <83.87%> (+<0.01%) ⬆️
test 46.33% <3.22%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 26, 2026

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing larsevj:enif_nan_filtering (a38553e) with main (30605cb)

Open in CodSpeed

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.

2 participants