-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor and check conformity #62
base: main
Are you sure you want to change the base?
Conversation
ac06ba3
to
fd82751
Compare
Add check on zone conformity defined in RMS grid building jobs
3f58059
to
affe089
Compare
'the grid and parameters should be shared and realisation = 1' | ||
) | ||
params = { | ||
'project': project, | ||
'model_file_name': get_specification_file( | ||
_type=SpecificationType.RESAMPLE, _format=ModelFileFormat.YML, **kwargs | ||
), | ||
'debug_level': Debug.VERBOSE, | ||
'debug_level': 2, |
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.
We should probably still use the Enum so that it is clearer what the intension is
@@ -29,14 +29,12 @@ | |||
# (including the added trends for those that should have trends) is then copied back to the geomodel grid. | |||
|
|||
from pathlib import Path | |||
from roxar import Direction | |||
from rmsapi import Direction |
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.
We aware this will break backwards-compatibility of older versions of RMS.
We should probably create an internal module, which tries rmsapi
and then fall back to roxar
.
# else: | ||
# # One such case is 'mixed conform' | ||
# raise NotImplementedError('{} is not supported'.format(conformity.name)) | ||
# return field_values |
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.
Commented out code can be removed
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.
This is no longer needed, then?
@@ -6,8 +6,7 @@ | |||
use FIELD keywords for petrophysical properties in ERT in Assisted History Matching. | |||
""" | |||
|
|||
import roxar | |||
import xml.etree.ElementTree as ET | |||
import rmsapi |
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.
Same as earlier
if prop.type == rmsapi.GridPropertyType.continuous: | ||
continuous_type_param_list.append(pname) | ||
elif prop.type == roxar.GridPropertyType.discrete: | ||
elif prop.type == rmsapi.GridPropertyType.discrete: |
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.
same
@@ -317,7 +316,7 @@ def from_ertbox_to_geogrid(project, params): | |||
"Use 'Eclipse grid standard' (upper left corner) as " | |||
'common grid index origin (right-handed grid) in FMU projects using ERT.' | |||
) | |||
if ertboxgrid_handedness != roxar.Direction.right: | |||
if ertboxgrid_handedness != rmsapi.Direction.right: |
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.
same
params = { | ||
'project': project, | ||
'debug_level': Debug.ON, | ||
'debug_level': 1, |
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.
We should use the enum when possible to be clear what the intension is
print('Copy 3D parameter from Geo grid to Ertbox grid') | ||
|
||
params = { | ||
'project': project, | ||
'debug_level': Debug.ON, | ||
'debug_level': 1, |
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.
same
@@ -23,9 +23,11 @@ | |||
from aps.utils.roxar.progress_bar import APSProgressBar | |||
from aps.utils.check_rms_interactive_or_batch import check_rms_execution_mode | |||
|
|||
from fmu.tools.rms.copy_rms_param_to_ertbox_grid import check_grid_layout |
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.
We should add flu.tool
as a dependency in pyproject.toml
Reasons for making this change
ERT update of field parameters require only one grid size for all field parameters. To handle this for the cases that:
the help grid 'ERTBOX' is introduced. This grid is of fixed size and not realization dependent. The geometry of this help grid is of no importance except that the lateral position and number of grid cells should match as far as possible the geogrid in map view.
A workflow updating field parameters involve a step where the geogrid field parameters for each zone is copied into the ERTBOX in a unique way and also that the values in the ERTBOX grid is copied back into the geogrid zones.
This mapping between geogrid and ERTBOX grid is the same whether the APS method for facies modelling is used in RMS or whether petrophysical parameters are used as field parameters to be updated in ERT.
To simplify maintenance it is an advantage to have this mapping located in one common repo for both applications using APS and for applications updating petrophysical field parameters.
The fmu-tools is chosen to be the location for the common code, and this involves a refactoring of the APS code to use the common code for the mapping.
The mapping depends on the conformity or grid layout of the zones in the geogrid. Up to now the conformity is specified by the users without any check that it actually is consistent with the grid layout. For APS this is specified in the GUI and for the petrophysical field parameters, it is specified in the input settings for the function copy_rms_param.
There exist, however a possibility for grids built in RMS with most common grid layout settings to get the information about grid layout from the RMS job directly. In the current PR , the user specified settings for grid layout in APS is checked with the RMS grid building job when possible. The check is possible if:
To handle the various cases, the check will accept the user specified settings for conformities for the zones if the check is not possible or the conformities are not implemented. If the grid conformities are one of the implemented versions (Proportional, TopConform, BaseConform), and there is a mismatch between the user specified conformities of a zone and the conformity used in the grid building job for the zone, either an error is raised or the conformities from the grid building job is returned and used depending on in which context the check (and get conformity) is used.
Related issues
Issue #47
Issue #59