Skip to content

fmuobs Add support for ERT observation with localization data#860

Draft
alifbe wants to merge 1 commit intoequinor:mainfrom
alifbe:fmuobs-localization
Draft

fmuobs Add support for ERT observation with localization data#860
alifbe wants to merge 1 commit intoequinor:mainfrom
alifbe:fmuobs-localization

Conversation

@alifbe
Copy link
Copy Markdown
Collaborator

@alifbe alifbe commented Apr 14, 2026

Closes #851

@alifbe alifbe force-pushed the fmuobs-localization branch from 6daeeb5 to 19f3d1e Compare April 14, 2026 16:42
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.43%. Comparing base (88003f2) to head (19f3d1e).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #860      +/-   ##
==========================================
+ Coverage   83.52%   84.43%   +0.90%     
==========================================
  Files          49       49              
  Lines        7279     7292      +13     
==========================================
+ Hits         6080     6157      +77     
+ Misses       1199     1135      -64     

☔ 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.

Copy link
Copy Markdown

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 parsing support for extended ERT observation files that include LOCALIZATION { ... } sub-blocks, ensuring these files can be read by fmuobs without failing.

Changes:

  • Add testdata ERT .obs file containing SUMMARY_OBSERVATION entries with LOCALIZATION blocks and an RFT_OBSERVATION entry.
  • Extend the ERT obs flattener to skip unlabeled subunit blocks (to avoid failing on LOCALIZATION).
  • Update/extend tests to include the new file and validate that LOCALIZATION is ignored while parsing remains correct.

Reviewed changes

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

File Description
tests/testdata_fmuobs/drogon_wbhp_rft_wct_gor_tracer_plt_local.obs Adds an extended ERT obs example including LOCALIZATION blocks (and RFT CSV reference) for regression coverage.
tests/test_fmuobs.py Includes the new .obs in parsing/roundtrip tests and adds a dedicated regression test for ignoring LOCALIZATION.
src/subscript/fmuobs/parsers.py Changes flatten_observation_unit() to skip single-word subunit keys (e.g. LOCALIZATION) instead of raising.
src/subscript/eclcompress/eclcompress.py Adjusts a comment (but currently risks reintroducing a Ruff line-length failure).

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

Comment thread tests/testdata_fmuobs/drogon_wbhp_rft_wct_gor_tracer_plt_local.obs Outdated
Comment thread src/subscript/fmuobs/parsers.py Outdated
Comment thread tests/test_fmuobs.py Outdated
Comment thread src/subscript/eclcompress/eclcompress.py
Copy link
Copy Markdown

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


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


for subunit in subunit_keys:
if len(subunit.split()) < 2:
if subunit.upper() in ("LOCALIZATION"):
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

subunit.upper() in ("LOCALIZATION") is using a string on the right-hand side, so it becomes a substring check (e.g., "LOC", "L" would also match) rather than an exact match. This can cause unrelated unlabeled subunit blocks to be silently ignored. Use an equality check (== "LOCALIZATION") or a 1-tuple (in ("LOCALIZATION",)) instead.

Suggested change
if subunit.upper() in ("LOCALIZATION"):
if subunit.upper() == "LOCALIZATION":

Copilot uses AI. Check for mistakes.
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.

Extended version of ERT observation file is not handled

3 participants