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

Fixed initialization to make the generated script work more generally #768

Conversation

oddvarlia
Copy link
Collaborator

The field statistics script can generate a python script to be used as a job in RMS to load the mean and std dev and probability field parameters calculated by the field statistics script. Fixed missing initialization to make the script more flexible and avoid errors.

@oddvarlia oddvarlia requested a review from alifbe January 13, 2025 10:02
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.15%. Comparing base (b03e9c2) to head (8f65f08).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #768   +/-   ##
=======================================
  Coverage   85.15%   85.15%           
=======================================
  Files          52       52           
  Lines        7418     7418           
=======================================
  Hits         6317     6317           
  Misses       1101     1101           

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

Copy link
Collaborator

@alifbe alifbe left a comment

Choose a reason for hiding this comment

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

Good improvement 👍

Just a comment on alternative solution.

Comment on lines +1633 to 1635
cont_prop_dict = None
if key in geogrid_fields_dict:
cont_prop_dict = geogrid_fields_dict[key]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks fine. One alternative solution is to use dictionary get method which reduces three lines of code into:

cont_prop_dict = geogrid_fields_dict.get(key, None)

@oddvarlia oddvarlia merged commit 71d97be into equinor:main Jan 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants