#14772 Python: Add EclipseCase.create_saturation_pressure_plots as object method and forward createSaturationPressurePlots to it

RimEclipseResultCase_createSaturationPressurePlots exposes the time step
(the legacy command hardcodes 0) and returns an error when no plots
could be created. It only shows the plot window when a GUI is running;
the legacy code dereferenced RiaGuiApplication::instance()
unconditionally. RicfCreateSaturationPressurePlots resolves the cases
and loops, treating per-case failures as warnings as before.

The hand-written Case.create_saturation_pressure_plots() Python wrapper
is removed since the generated EclipseCase method shadows it.
This commit is contained in:
Kristian Bendiksen committed 2026-09-22 14:19:23 +02:00
1 parent 3ce81c4eca
commit cc1f09b665
5 files changed
+119 -57

No files matched your search

-11
View File
@@ -561,17 +561,6 @@ def create_lgr_for_completion(
)
@add_method(Case)
def create_saturation_pressure_plots(self) -> Any:
"""
Create saturation pressure plots for the current case
"""
case_ids = [self.id]
return self._execute_command(
createSaturationPressurePlots=Cmd.CreateSatPressPlotRequest(caseIds=case_ids)
)
@add_method(Case)
def available_properties(
self,
@@ -451,3 +451,11 @@ def test_10k_result_alias(rips_instance, initialize_test):
with pytest.raises(rips.RipsError, match="No such result"):
case.grid_property(rips.PropertyType.DYNAMIC_NATIVE, "SPOIL", 3)
def test_create_saturation_pressure_plots_requires_data(rips_instance, initialize_test):
# None of the test models carry EQUIL/PBUB/PDEW data, so the method must report a clear error
case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(case_path)
with pytest.raises(rips.RipsError):
case.create_saturation_pressure_plots()