From 1d038af7f3877ea65f2819554fe3bda4126ad26d Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Fri, 13 Sep 2024 13:25:28 +0200 Subject: [PATCH 1/4] Add script to calculate mean, stdev for continuous 3D field parameters and estimated facies probabilities for discrete 3D parameter --- .../WF_FIELD_PARAM_STATISTICS | 23 ++++++++ .../field_statistics/field_param_stat.yml | 59 +++++++++++++++++++ .../field_statistics/field_statistics.py | 5 +- .../wf_field_param_statistics | 1 + tests/test_field_statistics.py | 4 +- 5 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 src/subscript/field_statistics/WF_FIELD_PARAM_STATISTICS create mode 100644 src/subscript/field_statistics/field_param_stat.yml create mode 100644 src/subscript/field_statistics/wf_field_param_statistics diff --git a/src/subscript/field_statistics/WF_FIELD_PARAM_STATISTICS b/src/subscript/field_statistics/WF_FIELD_PARAM_STATISTICS new file mode 100644 index 000000000..03d8afbca --- /dev/null +++ b/src/subscript/field_statistics/WF_FIELD_PARAM_STATISTICS @@ -0,0 +1,23 @@ +-- Workflow job for ERT to calculate: +-- Mean and standard deviatons of specified continuous 3D parameters. +-- Estimate of facies probabilities from discrete 3D parameter for facies. +-- The input realizations are found under: +-- /realization-*/iter-*/share/results/grids/geogrid--.roff +-- The output mean and standard deviations and facies probability estimates are saved +-- under a directory specified by the user. +INTERNAL False +EXECUTABLE ../scripts/field_statistics.py + +MIN_ARG 6 +ARG_TYPE 0 STRING +ARG_TYPE 1 STRING +ARG_TYPE 2 STRING +ARG_TYPE 3 STRING +ARG_TYPE 4 STRING +ARG_TYPE 5 STRING +ARG_TYPE 6 STRING +ARG_TYPE 7 STRING + + + + diff --git a/src/subscript/field_statistics/field_param_stat.yml b/src/subscript/field_statistics/field_param_stat.yml new file mode 100644 index 000000000..7bf22bf83 --- /dev/null +++ b/src/subscript/field_statistics/field_param_stat.yml @@ -0,0 +1,59 @@ +# Configuration file for script wf_field_param_statistics.py +field_stat: + # Number of realizations for specified ensemble + # Required. + nreal: 100 + + # Iteration numbers from ES-MDA in ERT (iteration = 0 is initial ensemble, + # usually iteration=3 is final updated ensemble) + # Required. + iterations: [0, 3] + + # Selected set of zone names to use in calculations of statistics. + # Must be one or more of the defined zones. + # Require at least one zone to be selected. + use_zones: ["Valysar", "Therys", "Volon"] + + # Zone numbers with zone name dictionary + zone_code_names: + 1: "Valysar" + 2: "Therys" + 3: "Volon" + + # For each zone specify either Proportional, Top_conform or Base_conform + # as grid conformity. + # Conformity can be checked by opening the RMS job that has created + # the geogrid and check the grid settings for grid layers. + # Proportional means that number of layers is specified. + # Top or base conform means that grid cell thickness is specified. + # Required (but only for zones you want to use) + zone_conformity: + "Valysar": "Proportional" + "Therys": "Top_conform" + "Volon": "Proportional" + + # For each zone specify which discrete parameter to use to calculate + # facies probability estimates. + # Possible names are those found in the + # share/results/grids/geogrid--.roff + # files that are of discrete type. + # This key can be omitted or some of the lines specifying parameters + # for a zone if you don't want to use it. + discrete_property_param_per_zone: + "Valysar": ["facies"] + "Therys": ["facies"] + "Volon": ["facies"] + + # For each zone specify which continuous parameter to use to + # calculate estimate of mean and stdev over ensemble. + # Possible names are those found in the + # share/results/grids/geogrid--.roff + # files that are of continuous type + # This key can be omitted or some of the lines specifying + # parameters for a zone if you don't want to use it. + continuous_property_param_per_zone: + "Valysar": ["phit"] + "Therys": ["phit"] + + # Size of ertbox grid for (nx, ny, nz) + ertbox_size: [92, 146, 66] \ No newline at end of file diff --git a/src/subscript/field_statistics/field_statistics.py b/src/subscript/field_statistics/field_statistics.py index 384c0bae9..9aa5dfd1d 100644 --- a/src/subscript/field_statistics/field_statistics.py +++ b/src/subscript/field_statistics/field_statistics.py @@ -23,8 +23,10 @@ import numpy as np import xtgeo import yaml + from ert.config import ErtScript + import subscript logger = subscript.getLogger(__name__) @@ -53,6 +55,7 @@ The assumption behind this method (using ERTBOX grid as a fixed common grid for all realizations) is: + * The lateral extension of the geogrid is close to a regular grid with same orientation and grid resolution as the ERTBOX grid. * The ERTBOX grid should be the same as used in ERT when field parameters @@ -166,6 +169,7 @@ LOAD_WORKFLOW ../../bin/workflows/wf_field_param_statistics -- The workflow file to be located under ert/bin/workflows: + FIELD_STATISTICS -c -p -e // @@ -389,7 +393,6 @@ def get_values_in_ertbox( ertbox_prop_values[:, :, start_layer_ertbox:] = prop_values[ :, :, start_layer:end_layer ] - return ertbox_prop_values diff --git a/src/subscript/field_statistics/wf_field_param_statistics b/src/subscript/field_statistics/wf_field_param_statistics new file mode 100644 index 000000000..96948ff57 --- /dev/null +++ b/src/subscript/field_statistics/wf_field_param_statistics @@ -0,0 +1 @@ +WF_FIELD_PARAM_STATISTICS -c -p -e // diff --git a/tests/test_field_statistics.py b/tests/test_field_statistics.py index c4303a44a..f84bb0685 100644 --- a/tests/test_field_statistics.py +++ b/tests/test_field_statistics.py @@ -58,11 +58,9 @@ "use_population_stdev": False, } - def make_box_grid(dimensions, grid_name, result_path): filename = result_path / Path(grid_name + ".roff") filename_egrid = result_path / Path(grid_name.upper() + ".EGRID") - grid = xtgeo.create_box_grid(dimensions) grid.name = grid_name print(f"Grid name: {grid.name}") @@ -232,6 +230,7 @@ def make_ensemble_test_data( xtgeo_geogrid.set_actnum(xtgeo_active) set_subgrid_names(xtgeo_geogrid, new_subgrids=subgrid_dict) xtgeo_geogrid.to_file(filename_grid, fformat="roff") + if print_info: print( "Testdata for ensemble for zone " @@ -431,7 +430,6 @@ def compare_with_referencedata(ens_path, result_path, print_check=False): if words[0] in ["mean", "stdev", "prob"]: fullfilename = result_path / Path("ertbox--" + name) reference_filename = result_path / Path("referencedata") / Path(name) - grid_property = xtgeo.gridproperty_from_file(fullfilename, fformat="roff") grid_property_reference = xtgeo.gridproperty_from_file( reference_filename, fformat="roff" From 4adabf6249f890d5d7f206f13fb909b79dc687d6 Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Thu, 26 Sep 2024 13:59:32 +0200 Subject: [PATCH 2/4] Generated test data is written to tmp directory, added subscript doc minimum version --- .../{WF_FIELD_PARAM_STATISTICS => FIELD_STATISTICS} | 0 src/subscript/field_statistics/field_statistics.py | 2 +- src/subscript/field_statistics/wf_field_param_statistics | 1 - src/subscript/field_statistics/wf_field_statistics | 2 ++ tests/test_field_statistics.py | 2 ++ 5 files changed, 5 insertions(+), 2 deletions(-) rename src/subscript/field_statistics/{WF_FIELD_PARAM_STATISTICS => FIELD_STATISTICS} (100%) delete mode 100644 src/subscript/field_statistics/wf_field_param_statistics create mode 100644 src/subscript/field_statistics/wf_field_statistics diff --git a/src/subscript/field_statistics/WF_FIELD_PARAM_STATISTICS b/src/subscript/field_statistics/FIELD_STATISTICS similarity index 100% rename from src/subscript/field_statistics/WF_FIELD_PARAM_STATISTICS rename to src/subscript/field_statistics/FIELD_STATISTICS diff --git a/src/subscript/field_statistics/field_statistics.py b/src/subscript/field_statistics/field_statistics.py index 9aa5dfd1d..90f264f3d 100644 --- a/src/subscript/field_statistics/field_statistics.py +++ b/src/subscript/field_statistics/field_statistics.py @@ -23,6 +23,7 @@ import numpy as np import xtgeo import yaml +from ert.config import ErtScript from ert.config import ErtScript @@ -169,7 +170,6 @@ LOAD_WORKFLOW ../../bin/workflows/wf_field_param_statistics -- The workflow file to be located under ert/bin/workflows: - FIELD_STATISTICS -c -p -e // diff --git a/src/subscript/field_statistics/wf_field_param_statistics b/src/subscript/field_statistics/wf_field_param_statistics deleted file mode 100644 index 96948ff57..000000000 --- a/src/subscript/field_statistics/wf_field_param_statistics +++ /dev/null @@ -1 +0,0 @@ -WF_FIELD_PARAM_STATISTICS -c -p -e // diff --git a/src/subscript/field_statistics/wf_field_statistics b/src/subscript/field_statistics/wf_field_statistics new file mode 100644 index 000000000..c83727b3d --- /dev/null +++ b/src/subscript/field_statistics/wf_field_statistics @@ -0,0 +1,2 @@ +FIELD_STATISTICS -c -p -e // -r + diff --git a/tests/test_field_statistics.py b/tests/test_field_statistics.py index f84bb0685..2b871e35d 100644 --- a/tests/test_field_statistics.py +++ b/tests/test_field_statistics.py @@ -58,9 +58,11 @@ "use_population_stdev": False, } + def make_box_grid(dimensions, grid_name, result_path): filename = result_path / Path(grid_name + ".roff") filename_egrid = result_path / Path(grid_name.upper() + ".EGRID") + grid = xtgeo.create_box_grid(dimensions) grid.name = grid_name print(f"Grid name: {grid.name}") From 761eaecb451e878be546a5624f8f26019b507106 Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Fri, 27 Sep 2024 00:20:15 +0200 Subject: [PATCH 3/4] Updated pyproject.toml and removed unnecessary files --- .../field_statistics/FIELD_STATISTICS | 23 -------- .../field_statistics/field_param_stat.yml | 59 ------------------- .../field_statistics/wf_field_statistics | 2 - 3 files changed, 84 deletions(-) delete mode 100644 src/subscript/field_statistics/FIELD_STATISTICS delete mode 100644 src/subscript/field_statistics/field_param_stat.yml delete mode 100644 src/subscript/field_statistics/wf_field_statistics diff --git a/src/subscript/field_statistics/FIELD_STATISTICS b/src/subscript/field_statistics/FIELD_STATISTICS deleted file mode 100644 index 03d8afbca..000000000 --- a/src/subscript/field_statistics/FIELD_STATISTICS +++ /dev/null @@ -1,23 +0,0 @@ --- Workflow job for ERT to calculate: --- Mean and standard deviatons of specified continuous 3D parameters. --- Estimate of facies probabilities from discrete 3D parameter for facies. --- The input realizations are found under: --- /realization-*/iter-*/share/results/grids/geogrid--.roff --- The output mean and standard deviations and facies probability estimates are saved --- under a directory specified by the user. -INTERNAL False -EXECUTABLE ../scripts/field_statistics.py - -MIN_ARG 6 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 STRING -ARG_TYPE 3 STRING -ARG_TYPE 4 STRING -ARG_TYPE 5 STRING -ARG_TYPE 6 STRING -ARG_TYPE 7 STRING - - - - diff --git a/src/subscript/field_statistics/field_param_stat.yml b/src/subscript/field_statistics/field_param_stat.yml deleted file mode 100644 index 7bf22bf83..000000000 --- a/src/subscript/field_statistics/field_param_stat.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Configuration file for script wf_field_param_statistics.py -field_stat: - # Number of realizations for specified ensemble - # Required. - nreal: 100 - - # Iteration numbers from ES-MDA in ERT (iteration = 0 is initial ensemble, - # usually iteration=3 is final updated ensemble) - # Required. - iterations: [0, 3] - - # Selected set of zone names to use in calculations of statistics. - # Must be one or more of the defined zones. - # Require at least one zone to be selected. - use_zones: ["Valysar", "Therys", "Volon"] - - # Zone numbers with zone name dictionary - zone_code_names: - 1: "Valysar" - 2: "Therys" - 3: "Volon" - - # For each zone specify either Proportional, Top_conform or Base_conform - # as grid conformity. - # Conformity can be checked by opening the RMS job that has created - # the geogrid and check the grid settings for grid layers. - # Proportional means that number of layers is specified. - # Top or base conform means that grid cell thickness is specified. - # Required (but only for zones you want to use) - zone_conformity: - "Valysar": "Proportional" - "Therys": "Top_conform" - "Volon": "Proportional" - - # For each zone specify which discrete parameter to use to calculate - # facies probability estimates. - # Possible names are those found in the - # share/results/grids/geogrid--.roff - # files that are of discrete type. - # This key can be omitted or some of the lines specifying parameters - # for a zone if you don't want to use it. - discrete_property_param_per_zone: - "Valysar": ["facies"] - "Therys": ["facies"] - "Volon": ["facies"] - - # For each zone specify which continuous parameter to use to - # calculate estimate of mean and stdev over ensemble. - # Possible names are those found in the - # share/results/grids/geogrid--.roff - # files that are of continuous type - # This key can be omitted or some of the lines specifying - # parameters for a zone if you don't want to use it. - continuous_property_param_per_zone: - "Valysar": ["phit"] - "Therys": ["phit"] - - # Size of ertbox grid for (nx, ny, nz) - ertbox_size: [92, 146, 66] \ No newline at end of file diff --git a/src/subscript/field_statistics/wf_field_statistics b/src/subscript/field_statistics/wf_field_statistics deleted file mode 100644 index c83727b3d..000000000 --- a/src/subscript/field_statistics/wf_field_statistics +++ /dev/null @@ -1,2 +0,0 @@ -FIELD_STATISTICS -c -p -e // -r - From c29a4a5e84d4382d871e3264ca79d175754e27eb Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Fri, 27 Sep 2024 12:51:16 +0200 Subject: [PATCH 4/4] Fixed a missing copy of files Some doc updates and some result files name changes --- .../field_statistics/field_statistics.py | 194 ++++++++++++++++-- tests/test_field_statistics.py | 7 +- 2 files changed, 185 insertions(+), 16 deletions(-) diff --git a/src/subscript/field_statistics/field_statistics.py b/src/subscript/field_statistics/field_statistics.py index 90f264f3d..59127538c 100644 --- a/src/subscript/field_statistics/field_statistics.py +++ b/src/subscript/field_statistics/field_statistics.py @@ -25,9 +25,6 @@ import yaml from ert.config import ErtScript -from ert.config import ErtScript - - import subscript logger = subscript.getLogger(__name__) @@ -166,23 +163,26 @@ -- Installation of the ERT workflow: DEFINE ../input/config/field_param_stat.yml -LOAD_WORKFLOW_JOB ../../bin/jobs/WF_FIELD_PARAM_STATISTICS +-- The workflow job FIELD_STATISTICS is generated automatically by ERT +-- The workflow file wf_field_param_statistics run FIELD_STATISTICS LOAD_WORKFLOW ../../bin/workflows/wf_field_param_statistics --- The workflow file to be located under ert/bin/workflows: +-- The workflow file to be located under ert/bin/workflows run FIELD_STATISTICS: +-- Example of a workflow file can be FIELD_STATISTICS -c -p -e // -r --- Workflow job for ERT to calculate: --- Mean and standard deviatons of specified continuous 3D parameters. --- Estimate of facies probabilities from discrete 3D parameter for facies. --- The input realizations are found under: --- /realization-*/iter-*/share/results/grids/geogrid--.roff --- The output mean and standard deviations and facies probability estimates are saved --- under a directory specified by the user. --- The first three command line arguments are required, the last one () --- has default 'share/grid_statistics' under . +-- where is the usre specification for this script, +-- and where is the ERT for the ERT project, +-- and where ensemble directory is specified by the '-e' option and +-- where the result directory is specified by the . This is optional +-- since share/grid_statistics is used as default. +-- The results from iter-0 is also copied to 'realization-0/iter-0/share/results/grids +-- and results from iter-3 is copied to 'realization-0/iter-3/share/results/grids. +-- Workflow job for ERT to calculate field statistics is automatically +-- generated by ERT from the subscript repository, but when setting it +-- up manually, it look like this: INTERNAL False EXECUTABLE ../scripts/field_statistics.py @@ -237,6 +237,11 @@ def field_stat(args): if args.resultpath: relative_result_path = Path(args.resultpath) result_path = ens_path / relative_result_path + + rms_load_script = None + if args.generate_rms_load_script: + rms_load_script = args.generate_rms_load_script + glob_var_config_path = ert_config_path / Path(GLOBAL_VARIABLES_FILE) cfg_global = utils.yaml_load(glob_var_config_path)["global"] keyword = "FACIES_ZONE" @@ -256,6 +261,12 @@ def field_stat(args): calc_stats( field_stat, ens_path, facies_per_zone, result_path, ert_config_path, ertbox_size ) + ertbox_path = ert_config_path / ERTBOX_GRID_PATH + copy_ertbox_grid_to_result_path(ertbox_path, result_path) + + if rms_load_script: + generate_script(rms_load_script, ert_config_path, result_path, config_file) + logger.info( "Finished running workflow to calculate statistics " "for ensemble of field parameters" @@ -312,6 +323,14 @@ def get_parser() -> argparse.ArgumentParser: action="version", version="%(prog)s (subscript version " + subscript.__version__ + ")", ) + + parser.add_argument( + "-z", + "--generate_rms_load_script", + type=str, + default="tmp_import_ensemble_field_statistics.py", + help=("Name of script for loading results into RMS for visualization. "), + ) return parser @@ -604,6 +623,31 @@ def get_ertbox_size(ertbox_path): return ertbox_grid.dimensions +def copy_ertbox_grid_to_result_path(ertbox_path, result_path): + if not Path(ertbox_path).exists(): + raise IOError(f"The ertbox file does not exist in: {ertbox_path}") + ertbox_grid = xtgeo.grid_from_file(ertbox_path, fformat="egrid") + grid_file_name = result_path / Path("ertbox.roff") + print(f"Copy ertbox grid file from {ertbox_path} to {grid_file_name}") + ertbox_grid.to_file(grid_file_name, fformat="roff") + + +def copy_to_real0_dirs(field_stat, result_path, ens_path): + import glob + import shutil + + iteration_list = field_stat["iterations"] + for iter in iteration_list: + source_files = result_path / Path(f"ertbox--*_{iter}.roff") + target_dir = ens_path / Path(f"realization-0/iter-{iter}/share/results/grids") + print(f"Source_files: {source_files}") + print(f"Target dir: {target_dir}") + for f in glob.glob(source_files.as_posix()): + shutil.copy(f, target_dir.as_posix()) + source_file = result_path / Path("ertbox.roff") + shutil.copy(source_file.as_posix(), target_dir.as_posix()) + + def check_zone_conformity(zone_code_names, zone_names_used, zone_conformity): for zone_name, conformity in zone_conformity.items(): if zone_name not in list(zone_code_names.values()): @@ -890,6 +934,128 @@ def calc_stats( logger.info(txt) +def generate_script( + rms_load_script, ert_config_path, result_path, field_stat_config_file +): + template_string = """#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from pathlib import Path +import xtgeo +import yaml +import fmu.config.utilities as utils + +PRJ = project + +GRIDNAME = "ERTBOX" + +ERT_CONFIG_PATH = "{ert_config_path}" + +GLOBAL_VARIABLES_FILE = \ + ERT_CONFIG_PATH / Path("../../fmuconfig/output/global_variables.yml") + +FIELD_STAT_CONFIG_FILE = "{field_stat_config_file}" + +RESULT_PATH = "{result_path}" + + +LABEL = "drogon" + +def read_field_stat_config(config_file_name): + print(f"Read file: {{config_file_name}}") + with open(config_file_name, encoding="utf-8") as yml_file: + return yaml.safe_load(yml_file) + +def get_facies_per_zone(glob_var_file): + cfg_global = utils.yaml_load(glob_var_file)["global"] + keyword = "FACIES_ZONE" + if keyword in cfg_global: + facies_per_zone = cfg_global[keyword] + else: + raise KeyError(f"Missing keyword: {{keyword}} in {{GLOBAL_VARIABLES_FILE}}") + return facies_per_zone + +def main(): + config_dict = read_field_stat_config(FIELD_STAT_CONFIG_FILE) + field_stat = config_dict["field_stat"] + zone_code_names = field_stat["zone_code_names"] + facies_per_zone = get_facies_per_zone(GLOBAL_VARIABLES_FILE) + result_path = RESULT_PATH + zone_list= list(zone_code_names.values()) + stat_list= ["mean", "stdev"] + iter_list = field_stat["iterations"] + + cont_prop_dict = field_stat["continuous_property_param_per_zone"] + + discrete_prop_dict = field_stat["discrete_property_param_per_zone"] + + label = LABEL + for stat in stat_list: + for zone in zone_list: + for iteration in iter_list: + if cont_prop_dict: + if zone in cont_prop_dict: + for prop_name in cont_prop_dict[zone]: + name = \ + "ertbox--" + stat + "_" + zone + "_" + prop_name \ + + "_" + str(iteration) + print(f"Read: {{name}} into {{GRIDNAME}}") + filename = Path(result_path) / Path(name + ".roff") + prop_param = xtgeo.gridproperty_from_file( + filename, + fformat="roff") + prop_param.to_roxar(PRJ, GRIDNAME, name) + new_name = name + if label: + new_name = name + "_" + label + prop_param.name = new_name + name = "ertbox--nactive_" + zone + "_" + str(iteration) + print(f"Read: {{name}} into {{GRIDNAME}}") + filename = Path(result_path) / Path(name + ".roff") + prop_param = xtgeo.gridproperty_from_file( + filename, + fformat="roff" + ) + new_name = name + if label: + new_name = name + "_" + label + prop_param.name = new_name + prop_param.to_roxar(PRJ, GRIDNAME, new_name) + if discrete_prop_dict: + code_names_per_zone = facies_per_zone[zone] + for _, fname in code_names_per_zone.items(): + name = \ + "ertbox--prob_" + zone + "_" + fname + "_" + str(iteration) + print(f"Read: {{name}} into {{GRIDNAME}}") + filename = Path(result_path) / Path(name + ".roff") + prop_param = \ + xtgeo.gridproperty_from_file(filename, fformat="roff") + new_name = name + if label: + new_name = name + "_" + label + prop_param.name = new_name + prop_param.to_roxar(PRJ, GRIDNAME, new_name) + name = "ertbox--nactive_" + zone + "_" + str(iteration) + print(f"Read: {{name}} into {{GRIDNAME}}") + filename = Path(result_path) / Path(name + ".roff") + prop_param = xtgeo.gridproperty_from_file(filename, fformat="roff") + prop_param.to_roxar(PRJ, GRIDNAME, name) + +if __name__ == "__main__": + main() +""" + print(f"Write file: {rms_load_script}") + with open(rms_load_script, "w") as file: + file.write( + template_string.format( + ert_config_path=ert_config_path, + field_stat_config_file=field_stat_config_file, + result_path=result_path, + ) + ) + file.write("\n") + + class FieldStatistics(ErtScript): """This class defines the ERT workflow hook. diff --git a/tests/test_field_statistics.py b/tests/test_field_statistics.py index 2b871e35d..d073b2fae 100644 --- a/tests/test_field_statistics.py +++ b/tests/test_field_statistics.py @@ -28,7 +28,7 @@ ERT_CONFIG_PATH = Path("ert/model") DATADIR = Path(__file__).absolute().parent / TESTDATA GLOBAL_VARIABLES_FILE = Path("../../fmuconfig/output/global_variables.yml") - +RMS_LOAD_SCRIPT_NAME = "tmp_import_field_stat_results.py" CONFIG_DICT = { "nreal": 10, @@ -64,7 +64,7 @@ def make_box_grid(dimensions, grid_name, result_path): filename_egrid = result_path / Path(grid_name.upper() + ".EGRID") grid = xtgeo.create_box_grid(dimensions) - grid.name = grid_name + grid.name = grid_name.lower() print(f"Grid name: {grid.name}") print(f"Grid dimensions: {grid.dimensions}") print(f"Write grid to file: {filename}") @@ -891,6 +891,7 @@ def test_main(tmp_path, config_file, config_dict, print_info=True): ens_path = tmp_testdata_path / ENSEMBLE result_path = ens_path / RESULT_PATH + rms_load_script = result_path / RMS_LOAD_SCRIPT_NAME # Run the main script as a subprocess script_name = Path(__file__).absolute().parent.parent / Path( "src/subscript/field_statistics/field_statistics.py" @@ -911,6 +912,8 @@ def test_main(tmp_path, config_file, config_dict, print_info=True): ens_path.as_posix(), "-r", result_path.as_posix(), + "-z", + rms_load_script.as_posix(), ] ) # For this test not to fail, the CONFIG_DICT and the specified