Added date argument in prtvol2csv (#712)#850
Conversation
lilbe66
commented
Feb 13, 2026
- Added date argument to prtvol2csv.py, to extract volumes from PRT file at the specified date
- Included function to search for report date in PRT file
- Check that a volume report exists at the specified date
- Check that the date provided has ISO 8601 format, or one of the strings "first" and "last"
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #850 +/- ##
==========================================
+ Coverage 83.52% 83.63% +0.10%
==========================================
Files 49 49
Lines 7279 7339 +60
==========================================
+ Hits 6080 6138 +58
- Misses 1199 1201 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request adds functionality to extract volumes from PRT files at a specified date by introducing a --date argument to the prtvol2csv tool. The changes allow users to specify either an ISO-8601 formatted date (YYYY-MM-DD) or the strings "first" or "last" to select which BALANCE report to extract volumes from.
Changes:
- Added date argument support with validation for ISO-8601 format or "first"/"last" keywords
- Modified function signatures to return additional date information
- Added helper functions for date parsing and validation from PRT files
- Enhanced test coverage with new test cases and test data
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| src/subscript/prtvol2csv/prtvol2csv.py | Core implementation: added date parameter, date parsing functions, and modified return types to include date information |
| tests/test_prtvol2csv.py | Added comprehensive tests for date parsing, validation, and command-line usage with date argument |
| src/subscript/rmsecl_volumetrics/rmsecl_volumetrics.py | Updated to handle new tuple return type from currently_in_place_from_prt |
| tests/testdata_prtvol2csv/DROGON_NOBAL_FLOW.PRT | New test data file for Flow PRT files without BALANCE reports |
| tests/testdata_prtvol2csv/0readme.txt | Documentation of test data files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "--date", | ||
| "<DATE>", | ||
| "<DATAFILE>", | ||
| ], | ||
| default_mapping={ | ||
| "<DIR>": "share/results/volumes", | ||
| "<OUTPUTFILENAME>": "simulator_volume_fipnum.csv", | ||
| "<REGIONS>": "", | ||
| "<FIPNAME>": "FIPNUM", | ||
| "<DATE>": "first", |
There was a problem hiding this comment.
<DATE> is a magic word in ERT and will be replace with current date. This will cause an error because PRTVOL2CSV cannot find report on that specified date.
| "--date", | |
| "<DATE>", | |
| "<DATAFILE>", | |
| ], | |
| default_mapping={ | |
| "<DIR>": "share/results/volumes", | |
| "<OUTPUTFILENAME>": "simulator_volume_fipnum.csv", | |
| "<REGIONS>": "", | |
| "<FIPNAME>": "FIPNUM", | |
| "<DATE>": "first", | |
| "--date", | |
| "<REPORT_DATE>", | |
| "<DATAFILE>", | |
| ], | |
| default_mapping={ | |
| "<DIR>": "share/results/volumes", | |
| "<OUTPUTFILENAME>": "simulator_volume_fipnum.csv", | |
| "<REGIONS>": "", | |
| "<FIPNAME>": "FIPNUM", | |
| "<REPORT_DATE>": "first", |