Skip to content
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

Fix an issue where summary dates are not precise enough #6897

Merged
merged 3 commits into from
Jan 10, 2024

Conversation

eivindjahren
Copy link
Contributor

@eivindjahren eivindjahren commented Jan 4, 2024

Circumevents equinor/resdata#906 by reimlementing the summary reading with resfo. This also makes for a performance increase for summaries with many keys, but slightly worse performance (15%) for summaries with many dates.

This also ensures that float32 values are not converted in any way which removes precision loss. This also means that snapshots/reference values need to be updated.


  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure tests pass locally (after every commit!)

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@eivindjahren eivindjahren changed the title Reimplement eclsum backup Fix an issue where summary dates was not precise enough Jan 4, 2024
@eivindjahren eivindjahren added the release-notes:bug-fix Automatically categorise as bug fix in release notes label Jan 4, 2024
@eivindjahren eivindjahren force-pushed the reimplement_eclsum_backup branch 14 times, most recently from 36ecd51 to ae3c95d Compare January 5, 2024 12:48
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (e5ee36d) 83.76% compared to head (68fc26d) 84.16%.
Report is 4 commits behind head on main.

Files Patch % Lines
src/ert/config/_read_summary.py 97.37% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6897      +/-   ##
==========================================
+ Coverage   83.76%   84.16%   +0.39%     
==========================================
  Files         368      368              
  Lines       21660    21860     +200     
  Branches      948      911      -37     
==========================================
+ Hits        18144    18398     +254     
+ Misses       3222     3168      -54     
  Partials      294      294              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eivindjahren eivindjahren self-assigned this Jan 5, 2024
@eivindjahren eivindjahren changed the title Fix an issue where summary dates was not precise enough Fix an issue where summary dates are not precise enough Jan 5, 2024
@eivindjahren eivindjahren force-pushed the reimplement_eclsum_backup branch 4 times, most recently from acb42a8 to 8b27390 Compare January 8, 2024 13:19
second_character = draw(st.sampled_from("OWGVLPT"))
third_character = draw(st.sampled_from("PIF"))
fourth_character = draw(st.sampled_from("RT"))
# local = draw(st.sampled_from(["", "L"])) if first_character in "BCW" else ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Stray comment, something that is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed now

try:
date_unit = DateUnit[unit_key]
except KeyError:
raise ValueError(f"Unknown date unit in {spec}: {unit_key}") from None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why dont you want the context here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the keyerror is just misleading compared to the ValueError raised.

@eivindjahren eivindjahren merged commit 18ac76c into equinor:main Jan 10, 2024
44 checks passed
@eivindjahren eivindjahren deleted the reimplement_eclsum_backup branch January 10, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:bug-fix Automatically categorise as bug fix in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants