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 the realization number for the stdout and stderr files #6501

Merged

Conversation

larsevj
Copy link
Contributor

@larsevj larsevj commented Nov 6, 2023

Issue
Resolves #6486

Pre review checklist

  • Read through the code changes carefully after finishing work
  • Make sure tests pass locally (after every commit!)
  • Prepare changes in small commits for more convenient review (optional)
  • PR title captures the intent of the changes, and is fitting for release notes.
  • Updated documentation
  • Ensured that unit tests are added for all new behavior (See
    Ground Rules),
    and changes to existing code have good test coverage.

Pre merge checklist

  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.

@larsevj larsevj added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Nov 6, 2023
@larsevj
Copy link
Contributor Author

larsevj commented Nov 6, 2023

Did a small refactoring in _job_data to avoid setting real = node.parent multiple times. Not strictly necessary in order to resolve the issue.

@andreas-el
Copy link
Contributor

Did a small refactoring in _job_data to avoid setting real = node.parent multiple times. Not strictly necessary in order to resolve the issue.

But nice, since it was probably wrong to begin with to set that variable twice.

What did concern me a bit though, was if all nodes actually had a parent. If that isn't the case, we now enforce the system to stop. I've tried to see if this is the case, but could not find any situation where that happened.

Ref.

def _job_data(self, index: QModelIndex, node: Node, role: int):
         assert node.parent
         real = node.parent

Copy link
Contributor

@andreas-el andreas-el left a comment

Choose a reason for hiding this comment

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

Nice! Seems to do the trick. Good work! 🚀

@larsevj
Copy link
Contributor Author

larsevj commented Nov 7, 2023

Did a small refactoring in _job_data to avoid setting real = node.parent multiple times. Not strictly necessary in order to resolve the issue.

But nice, since it was probably wrong to begin with to set that variable twice.

What did concern me a bit though, was if all nodes actually had a parent. If that isn't the case, we now enforce the system to stop. I've tried to see if this is the case, but could not find any situation where that happened.

Ref.

def _job_data(self, index: QModelIndex, node: Node, role: int):
         assert node.parent
         real = node.parent

Yes that assert part is probably a leftover from before, and it might be best to just remove it? I believe that _job_data will only be called on job - nodes, which should all have a realization node as parent?

@codecov-commenter
Copy link

Codecov Report

Merging #6501 (cacd8f4) into main (fcf4d19) will increase coverage by 0.00%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #6501   +/-   ##
=======================================
  Coverage   83.48%   83.48%           
=======================================
  Files         342      341    -1     
  Lines       20716    20715    -1     
  Branches      938      938           
=======================================
  Hits        17294    17294           
  Misses       3131     3131           
+ Partials      291      290    -1     
Files Coverage Δ
src/ert/gui/model/snapshot.py 89.63% <100.00%> (-0.04%) ⬇️
src/ert/gui/simulation/run_dialog.py 91.32% <ø> (ø)

... and 13 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@larsevj larsevj merged commit 7baeda9 into equinor:main Nov 7, 2023
43 of 44 checks passed
@larsevj larsevj deleted the Correct_the_realization_number_in_file_windows branch November 7, 2023 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stdout window header truncates realization numbers
3 participants