Skip to content

Commit

Permalink
Fix failing simulation wells tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Mar 18, 2024
1 parent a8b430a commit 5b046aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions GrpcInterface/Python/rips/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,10 @@ def simulation_wells(self):
:class:`rips.generated.generated_classes.SimulationWell`
"""
wells = self.descendants(SimulationWell)
return wells
if self.views():
# Use the first view to get simulation wells.
return self.views()[0].descendants(SimulationWell)
return []


@add_method(Case)
Expand Down
7 changes: 6 additions & 1 deletion GrpcInterface/Python/rips/simulation_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .resinsight_classes import SimulationWell

from .case import Case
from .view import View
from .pdmobject import PdmObjectBase, add_method

from typing import List, Optional
Expand Down Expand Up @@ -80,4 +81,8 @@ def cells(

@add_method(SimulationWell)
def case(self: SimulationWell) -> Optional[Case]:
return self.ancestor(Case)
view = self.ancestor(View)
if view:
return view.case()
else:
return None

0 comments on commit 5b046aa

Please sign in to comment.