#14772 Python: Add Project.load_case as object method and forward loadCase to it

RimProject_loadCase loads a grid case from file and returns the case
object. RicfLoadCase forwards to it and wraps the case id in the legacy
loadCaseResult. The hand-written Python Project.load_case() wrapper is
removed since the generated method has the same signature and returns
the most-derived case class.
This commit is contained in:
Kristian Bendiksen committed 2026-09-22 14:19:23 +02:00
1 parent cc1f09b665
commit 739f3744f6
4 files changed
+117 -45

No files matched your search

-15
View File
@@ -83,21 +83,6 @@ def close(self) -> None:
self._execute_command(closeProject=Empty())
@add_method(Project)
def load_case(self: Project, path: str, grid_only: bool = False) -> Reservoir:
"""Load a new grid case from the given file path
Arguments:
path(str): file path to case
Returns:
:class:`rips.generated.generated_classes.Case`
"""
command_reply = self._execute_command(
loadCase=Commands_pb2.FilePathRequest(path=path, gridOnly=grid_only)
)
return self.case(command_reply.loadCaseResult.id)
@add_method(Project)
def selected_cases(self) -> List[Case]:
"""Get a list of all grid cases selected in the project tree