Skip to content

Commit 628d66b

Browse files
authored
Merge pull request #998 from gempy-project/teamcity_config
[DOC] Update subsurface dependency and refactor tests for compatibility
2 parents 00888bc + 8325a6f commit 628d66b

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
[![GitHub Stars](https://img.shields.io/github/stars/cgre-aachen/gempy.svg)](https://github.com/cgre-aachen/gempy/stargazers)
44
[![GitHub Forks](https://img.shields.io/github/forks/cgre-aachen/gempy.svg)](https://github.com/cgre-aachen/gempy/network)
5+
[![Documentation Status](https://assets.readthedocs.org/static/projects/badges/passing-flat.svg)](http://docs.gempy.org)
6+
[![Build Status](http://terranigma-solutions.teamcity.com/app/rest/builds/buildType:(id:Gempy_TestingGemPy)/statusIcon)](http://terranigma-solutions.teamcity.com/viewType.html?buildTypeId=Gempy_TestingGemPy&guest=1)
57
[![PyPI](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/downloads/)
68
[![PyPI](https://img.shields.io/badge/pypi-1.0-blue.svg)](https://pypi.org/project/gempy/)
79
[![license: EUPL v1.2](https://img.shields.io/badge/license-EUPL%20v1.2-blue.svg)](https://github.com/cgre-aachen/gempy/blob/master/LICENSE)
8-
[![Documentation Status](https://assets.readthedocs.org/static/projects/badges/passing-flat.svg)](http://docs.gempy.org)
910
[![DOI](https://zenodo.org/badge/96211155.svg)](https://zenodo.org/badge/latestdoi/96211155)
1011

1112

requirements/dev-requirements.txt

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

33
pytest
4-
subsurface~=2024.2.0
4+
pyvista
5+
git+https://github.com/terranigma-solutions/subsurface.git@2025.0.0b2
56

67
# Testing
78
pytest-approvaltests

test/test_model_types/test_subduction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66

77
def test_subduction():
8-
data_path = os.path.abspath('../examples')
8+
# Get the directory containing the test file
9+
current_dir = os.path.dirname(os.path.abspath(__file__))
10+
# Navigate to examples directory relative to test location
11+
data_path = os.path.join(current_dir, '../..', 'examples')
912

1013
geo_model: gp.data.GeoModel = gp.create_geomodel(
1114
project_name='Onlap_relations',

test/test_modules/test_gempy_subsurface.py

Lines changed: 10 additions & 5 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

@@ -36,7 +36,9 @@ def test_gempy_to_subsurface():
3636

3737
concatenated_id_array = np.concatenate(vertex_id_array)
3838
concatenated_cell_id_array = np.concatenate(cell_id_array)
39-
39+
40+
subsurface = optional_dependencies.require_subsurface()
41+
ss = subsurface
4042
meshes: ss.UnstructuredData = ss.UnstructuredData.from_array(
4143
vertex=np.concatenate(vertex),
4244
cells=np.concatenate(simplex_list),
@@ -51,16 +53,19 @@ def test_gempy_to_subsurface():
5153

5254
def test_gempy_to_subsurface_II():
5355
model: gp.data.GeoModel = gp.generate_example_model(ExampleModel.ANTICLINE, compute_model=True)
54-
from gempy_engine.core.data.raw_arrays_solution import RawArraysSolution
56+
subsurface = optional_dependencies.require_subsurface()
57+
ss = subsurface
58+
5559
meshes: ss.UnstructuredData = model.solutions.raw_arrays.meshes_to_subsurface()
56-
5760
trisurf = subsurface.core.structs.unstructured_elements.triangular_surface.TriSurf(meshes)
5861
pyvista_mesh = ss.visualization.to_pyvista_mesh(trisurf)
5962
ss.visualization.pv_plot([pyvista_mesh], image_2d=True)
6063

6164

6265
def test_gempy_to_subsurface_III():
6366
model = gp.generate_example_model(ExampleModel.ANTICLINE, compute_model=True)
67+
subsurface = optional_dependencies.require_subsurface()
68+
ss = subsurface
6469
meshes: ss.UnstructuredData = model.solutions.meshes_to_unstruct()
6570

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

0 commit comments

Comments
 (0)