mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make Python code use the new generated skeleton and rename ResInsight parameters to fit
This commit is contained in:
@@ -20,7 +20,7 @@ def test_EmptyProject(rips_instance, initialize_test):
|
||||
def test_OneCase(rips_instance, initialize_test):
|
||||
case = rips_instance.project.load_case(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
|
||||
assert(case.name == "TEST10K_FLT_LGR_NNC")
|
||||
assert(case.case_id == 0)
|
||||
assert(case.id == 0)
|
||||
cases = rips_instance.project.cases()
|
||||
assert(len(cases) is 1)
|
||||
|
||||
@@ -120,11 +120,9 @@ def test_10k(rips_instance, initialize_test):
|
||||
def test_PdmObject(rips_instance, initialize_test):
|
||||
case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
|
||||
case = rips_instance.project.load_case(path=case_path)
|
||||
assert(case.case_id == 0)
|
||||
assert(case.id == 0)
|
||||
assert(case.address() is not 0)
|
||||
assert(case.class_keyword() == "EclipseCase")
|
||||
case_id = case.get_value('CaseId')
|
||||
assert(case_id == case.case_id)
|
||||
|
||||
@pytest.mark.skipif(sys.platform.startswith('linux'), reason="Brugge is currently exceptionally slow on Linux")
|
||||
def test_brugge_0010(rips_instance, initialize_test):
|
||||
@@ -146,21 +144,21 @@ def test_replaceCase(rips_instance, initialize_test):
|
||||
case = project.case(case_id=0)
|
||||
assert(case is not None)
|
||||
assert(case.name == "TEST10K_FLT_LGR_NNC")
|
||||
assert(case.case_id == 0)
|
||||
assert(case.id == 0)
|
||||
cases = rips_instance.project.cases()
|
||||
assert(len(cases) is 1)
|
||||
|
||||
case.replace(new_grid_file=case_path)
|
||||
# Check that the case object has been changed
|
||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
||||
assert(case.case_id == 0)
|
||||
assert(case.id == 0)
|
||||
|
||||
cases = rips_instance.project.cases()
|
||||
assert(len(cases) is 1)
|
||||
# Check that retrieving the case object again will yield the changed object
|
||||
case = project.case(case_id=0)
|
||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
||||
assert(case.case_id == 0)
|
||||
assert(case.id == 0)
|
||||
|
||||
def test_loadNonExistingCase(rips_instance, initialize_test):
|
||||
case_path = "Nonsense/Nonsense/Nonsense"
|
||||
|
||||
@@ -14,7 +14,7 @@ def test_loadProject(rips_instance, initialize_test):
|
||||
case = project.cases()[0]
|
||||
assert(case is not None)
|
||||
assert(case.name == "TEST10K_FLT_LGR_NNC")
|
||||
assert(case.case_id == 0)
|
||||
assert(case.id == 0)
|
||||
cases = rips_instance.project.cases()
|
||||
assert(len(cases) is 1)
|
||||
|
||||
@@ -23,15 +23,17 @@ def test_well_log_plots(rips_instance, initialize_test):
|
||||
plots = project.plots()
|
||||
well_log_plots = []
|
||||
for plot in plots:
|
||||
well_log_plot = rips.WellLogPlot.from_pdm_object(plot)
|
||||
well_log_plot = plot.cast(rips.WellLogPlot)
|
||||
if well_log_plot is not None:
|
||||
assert(well_log_plot.depth_type() == "MEASURED_DEPTH")
|
||||
well_log_plot.print_object_info()
|
||||
assert(well_log_plot.depth_type == "MEASURED_DEPTH")
|
||||
well_log_plots.append(well_log_plot)
|
||||
assert(len(well_log_plots) == 2)
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname:
|
||||
for well_log_plot in well_log_plots:
|
||||
well_log_plot.set_depth_type("TRUE_VERTICAL_DEPTH_RKB")
|
||||
well_log_plot.depth_type = "TRUE_VERTICAL_DEPTH_RKB"
|
||||
well_log_plot.update()
|
||||
if rips_instance.is_gui():
|
||||
well_log_plot.export_snapshot(tmpdirname)
|
||||
well_log_plot.export_data_as_las(tmpdirname)
|
||||
@@ -44,9 +46,9 @@ def test_well_log_plots(rips_instance, initialize_test):
|
||||
|
||||
plots2 = project.plots()
|
||||
for plot2 in plots2:
|
||||
well_log_plot2 = rips.WellLogPlot.from_pdm_object(plot)
|
||||
well_log_plot2 = plot2.cast(rips.WellLogPlot)
|
||||
if well_log_plot2 is not None:
|
||||
assert(well_log_plot2.depth_type() == "TRUE_VERTICAL_DEPTH_RKB")
|
||||
assert(well_log_plot2.depth_type == "TRUE_VERTICAL_DEPTH_RKB")
|
||||
|
||||
@pytest.mark.skipif(sys.platform.startswith('linux'), reason="Brugge is currently exceptionally slow on Linux")
|
||||
def test_loadGridCaseGroup(rips_instance, initialize_test):
|
||||
|
||||
@@ -12,8 +12,8 @@ def test_10k(rips_instance, initialize_test):
|
||||
case = rips_instance.project.load_case(path=case_path)
|
||||
assert(len(case.grids()) == 2)
|
||||
well_path_files = [case_root_path + "/wellpath_a.dev", case_root_path + "/wellpath_b.dev"]
|
||||
well_paths = rips_instance.project.import_well_paths(well_path_files)
|
||||
wells = rips_instance.project.wells()
|
||||
well_path_names = rips_instance.project.import_well_paths(well_path_files)
|
||||
wells = rips_instance.project.well_paths()
|
||||
assert(len(wells) == 2)
|
||||
assert(wells[0].name == "Well Path A")
|
||||
assert(wells[1].name == "Well Path B")
|
||||
|
||||
Reference in New Issue
Block a user