Skip to content

Commit 6022a54

Browse files
committed
[DOC] Update subsurface dependency and refactor tests for compatibility
1 parent aa91002 commit 6022a54

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

requirements/dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r optional-requirements.txt
22

33
pytest
4-
subsurface~=2024.2.0
4+
git+https://github.com/terranigma-solutions/subsurface[email protected]
55

66
# Testing
77
pytest-approvaltests

test/test_modules/test_gempy_subsurface.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import gempy as gp
44
import gempy_viewer as gpv
5-
import subsurface.core.structs.unstructured_elements.triangular_surface
5+
6+
from gempy import optional_dependencies
67
from gempy.core.data.enumerators import ExampleModel
78

89
import numpy as np
@@ -14,7 +15,6 @@
1415
reason="This test needs higher requirements."
1516
)
1617

17-
ss = pytest.importorskip("subsurface", reason="Subsurface is not installed")
1818
pd = pytest.importorskip("pandas", reason="Pandas is not installed")
1919

2020

@@ -51,16 +51,19 @@ def test_gempy_to_subsurface():
5151

5252
def test_gempy_to_subsurface_II():
5353
model: gp.data.GeoModel = gp.generate_example_model(ExampleModel.ANTICLINE, compute_model=True)
54-
from gempy_engine.core.data.raw_arrays_solution import RawArraysSolution
54+
subsurface = optional_dependencies.require_subsurface()
55+
ss = subsurface
56+
5557
meshes: ss.UnstructuredData = model.solutions.raw_arrays.meshes_to_subsurface()
56-
5758
trisurf = subsurface.core.structs.unstructured_elements.triangular_surface.TriSurf(meshes)
5859
pyvista_mesh = ss.visualization.to_pyvista_mesh(trisurf)
5960
ss.visualization.pv_plot([pyvista_mesh], image_2d=True)
6061

6162

6263
def test_gempy_to_subsurface_III():
6364
model = gp.generate_example_model(ExampleModel.ANTICLINE, compute_model=True)
65+
subsurface = optional_dependencies.require_subsurface()
66+
ss = subsurface
6467
meshes: ss.UnstructuredData = model.solutions.meshes_to_unstruct()
6568

6669
trisurf = subsurface.core.structs.unstructured_elements.triangular_surface.TriSurf(meshes)

0 commit comments

Comments
 (0)