Skip to content

Update field_statistics to use individual ertbox per zone - #858

Merged
oddvarlia merged 1 commit into
equinor:mainfrom
oddvarlia:update_field_statistics_with_zone_dependent_ertbox_grid
Aug 10, 2026
Merged

Update field_statistics to use individual ertbox per zone#858
oddvarlia merged 1 commit into
equinor:mainfrom
oddvarlia:update_field_statistics_with_zone_dependent_ertbox_grid

Conversation

@oddvarlia

Copy link
Copy Markdown
Collaborator

Closes: #842

@oddvarlia
oddvarlia marked this pull request as draft April 10, 2026 11:15
@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch from 8777229 to 0512285 Compare April 18, 2026 12:56
@codecov-commenter

codecov-commenter commented Apr 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.21311% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.28%. Comparing base (3317bd1) to head (42744f6).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/subscript/field_statistics/field_statistics.py 67.21% 80 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #858      +/-   ##
==========================================
- Coverage   84.51%   84.28%   -0.23%     
==========================================
  Files          49       49              
  Lines        7349     7528     +179     
==========================================
+ Hits         6211     6345     +134     
- Misses       1138     1183      +45     

☔ View full report in Codecov by Harness.
📢 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.

@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch 6 times, most recently from c7630cf to 335b994 Compare April 21, 2026 10:47
@oddvarlia
oddvarlia requested a review from alifbe April 21, 2026 15:00
@oddvarlia
oddvarlia marked this pull request as ready for review April 21, 2026 15:00
@oddvarlia
oddvarlia marked this pull request as draft April 30, 2026 13:15
@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch 8 times, most recently from c2443be to a7fdb52 Compare May 6, 2026 21:43
@oddvarlia
oddvarlia marked this pull request as ready for review May 6, 2026 21:54

@alifbe alifbe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not quite sure if the files in ensemble/share/grid_statistics/ are all needed.

In general, we should avoid code repetitions.

Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py
Comment thread src/subscript/field_statistics/field_statistics.py
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py Outdated
@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch 5 times, most recently from cddfb7c to 8771364 Compare August 6, 2026 07:28
@oddvarlia
oddvarlia requested a review from alifbe August 7, 2026 08:00
@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch from 8771364 to 7d5966f Compare August 7, 2026 08:55
@alifbe
alifbe requested a balanced review from Copilot August 10, 2026 06:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Extends field statistics to support zone-specific ERTBOX grids and temporary fields.

Changes:

  • Adds per-zone/default ERTBOX configuration and processing.
  • Updates RMS loading and statistics generation.
  • Expands test data and reference outputs.

Reviewed changes

Copilot reviewed 5 out of 61 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/subscript/field_statistics/field_statistics.py Implements per-zone ERTBOX support.
tests/test_field_statistics.py Expands statistics tests and fixtures.
tests/testdata_field_statistics/config_example.yml Demonstrates the new configuration.
tests/testdata_field_statistics/ensemble/share/grid_statistics/referencedata2/result_field_files.txt Lists expected geogrid outputs.
tests/testdata_field_statistics/ensemble/share/grid_statistics/referencedata2/temporary_field_files.txt Lists expected temporary-field outputs.
Suppressed comments (2)

src/subscript/field_statistics/field_statistics.py:1353

  • The default grid is read earlier using the configured name verbatim, but this copy step uppercases it. A valid custom default such as ertbox_global.EGRID therefore passes sizing and then fails here looking for ERTBOX_GLOBAL.EGRID. Use the configured filename consistently.
        ertbox_file = Path(ertbox_config_path) / Path(ertbox_default.upper() + ".EGRID")

src/subscript/field_statistics/field_statistics.py:1924

  • initial_relative_path comes from YAML as a string, so using / on it raises TypeError before any iteration-0 field can be read (the test config also supplies a string). Convert it to Path before joining.
            full_param_filename = init_path / Path(param_filename)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/subscript/field_statistics/field_statistics.py Outdated
Comment thread src/subscript/field_statistics/field_statistics.py
Comment thread src/subscript/field_statistics/field_statistics.py
Comment thread src/subscript/field_statistics/field_statistics.py
Comment thread tests/test_field_statistics.py Outdated
@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch from 7d5966f to 5752d09 Compare August 10, 2026 08:42
Comment thread src/subscript/field_statistics/field_statistics.py Outdated

@alifbe alifbe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The code is rather huge so it's a bit hard to do prop review. But looks good from what I can see. 👍

Suggest to replace assertion with exception.

Some model file changes from previous version was required
Documentation is updated.
@oddvarlia
oddvarlia force-pushed the update_field_statistics_with_zone_dependent_ertbox_grid branch from 5752d09 to 42744f6 Compare August 10, 2026 12:57
@oddvarlia
oddvarlia merged commit fb0e7bd into equinor:main Aug 10, 2026
7 checks passed
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.

Extend the field_statistics function to handle individual ertbox grid per zone

4 participants