-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove .DATA suffix from REFCASE path #5245
Remove .DATA suffix from REFCASE path #5245
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5245 +/- ##
==========================================
+ Coverage 73.17% 73.18% +0.01%
==========================================
Files 392 391 -1
Lines 26963 26871 -92
Branches 1965 1965
==========================================
- Hits 19729 19665 -64
+ Misses 6670 6642 -28
Partials 564 564
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
41ddef1
to
5f6ef7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except, the small comment, looks good 👍
@@ -179,6 +179,9 @@ def _load_refcase(refcase_file: Optional[str]) -> Optional[EclSum]: | |||
if refcase_file is None: | |||
return None | |||
|
|||
if refcase_file.endswith(".DATA"): | |||
refcase_file = refcase_file[:-5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this comment applies here as well: #5247 (comment)
This will remove any suffix present in the filepath/name Retain backwards compatibility where REFCASE had `.DATA` suffix The suffix is removed regardless, but this allows us to validate presence of refcase .UNSMRY and .SMSPEC files later.
5f6ef7b
to
fe71c01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One minor comment, but no need to action on it
@@ -179,6 +179,9 @@ def _load_refcase(refcase_file: Optional[str]) -> Optional[EclSum]: | |||
if refcase_file is None: | |||
return None | |||
|
|||
refcase_filepath = Path(refcase_file) | |||
refcase_file = str(refcase_filepath.parent / refcase_filepath.stem) | |||
|
|||
if not os.path.exists(refcase_file + ".UNSMRY"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outside the scope here, so no need to fix it, but since you are now using pathlib you can do:
if not (refcase_file / ".UNSMRY").exists:
Retain backwards compatibility where REFCASE had
.DATA
suffix The suffix is removed regardless, but this allows us to validate presence of refcase .UNSMRY and .SMSPEC files.Issue
Resolves #5244
Approach
Short description of the approach
Pre review checklist
Adding labels helps the maintainers when writing release notes. This is the list of release note labels.