Skip to content

Add additional tests around file_view behavior#1245

Merged
eivindjahren merged 1 commit into
mainfrom
add_the_tests
Jul 13, 2026
Merged

Add additional tests around file_view behavior#1245
eivindjahren merged 1 commit into
mainfrom
add_the_tests

Conversation

@eivindjahren

Copy link
Copy Markdown
Collaborator

These additional tests are required to be able to safely refactor rd_file_view

@eivindjahren eivindjahren force-pushed the add_the_tests branch 4 times, most recently from 5f50ae5 to 213f0a5 Compare July 13, 2026 09:08
@eivindjahren eivindjahren requested a review from Copilot July 13, 2026 09:09
@eivindjahren eivindjahren self-assigned this Jul 13, 2026
@eivindjahren eivindjahren moved this to Ready for Review in SCOUT Jul 13, 2026

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

This PR expands the Python test suite to better lock down rd_file_view-related behaviors and adjacent file-reading/refactoring surfaces (restart/LGR handling, summary vectors, index handling, and gravimetry interactions) so rd_file_view can be refactored more safely.

Changes:

  • Add a dedicated test_rd_file_view.py covering keyword view behaviors, restart sub-views, and file-mode semantics.
  • Add negative/edge-case tests for well type parsing, summary time/data vectors, restart-chain inclusion, and rd-file index/save_kw behavior.
  • Extend gravimetry tests to cover multi-phase cases and simulator variants.

Reviewed changes

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

Show a summary per file
File Description
tests/test_well.py Adds tests/helpers for invalid IWEL types and for loading wells from restart files containing an LGR block.
tests/rd_tests/test_rd_sum.py Adds tests for report-only vectors, report lookup by time, non-unified writer roundtrip, and restart-chain inclusion behaviors.
tests/rd_tests/test_rd_file.py Adds tests for corrupt/truncated index handling and for save_kw edge cases; updates index open call signature.
tests/rd_tests/test_rd_file_view.py New focused test module for ResdataFileView/view behavior including slicing, blocks, restart views, and file-mode semantics.
tests/rd_tests/test_grav.py Adds helpers and new gravimetry test cases for all-phase calculations, E300 keyword variants, and simulator-id error handling.

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

Comment thread tests/rd_tests/test_rd_file_view.py Outdated
Comment thread tests/rd_tests/test_rd_file_view.py
Comment thread tests/rd_tests/test_rd_file_view.py Outdated
@eivindjahren eivindjahren force-pushed the add_the_tests branch 2 times, most recently from 45cdbde to 8ae870c Compare July 13, 2026 09:46
@MagnusSletten

Copy link
Copy Markdown
Contributor

Can we add a reverse-slice test such as view[::-1]? The current tests only cover positive step values.

@eivindjahren eivindjahren force-pushed the add_the_tests branch 2 times, most recently from c3792c5 to 53cfd65 Compare July 13, 2026 10:02

@MagnusSletten MagnusSletten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! The negative test can be re-added on the other PR.

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

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

Comment thread tests/rd_tests/test_rd_file.py
Comment thread tests/rd_tests/test_rd_file.py
Comment thread tests/rd_tests/test_rd_file.py
Comment thread tests/rd_tests/test_rd_file.py
@eivindjahren eivindjahren merged commit 352f031 into main Jul 13, 2026
11 checks passed
@eivindjahren eivindjahren deleted the add_the_tests branch July 13, 2026 10:49
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in SCOUT Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants