Add additional tests around file_view behavior#1245
Merged
Conversation
5f50ae5 to
213f0a5
Compare
There was a problem hiding this comment.
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.pycovering 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.
45cdbde to
8ae870c
Compare
Contributor
|
Can we add a reverse-slice test such as view[::-1]? The current tests only cover positive step values. |
c3792c5 to
53cfd65
Compare
MagnusSletten
approved these changes
Jul 13, 2026
MagnusSletten
left a comment
Contributor
There was a problem hiding this comment.
Looks good! The negative test can be re-added on the other PR.
53cfd65 to
b8bacf0
Compare
b8bacf0 to
babba5e
Compare
babba5e to
7be8878
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These additional tests are required to be able to safely refactor rd_file_view