mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
#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:
1 parent
3ce81c4eca
commit
cc1f09b665
5 files changed
+119
-57
No files matched your search
@@ -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()
|
||||
Reference in new issue
Block a user