7
7
8
8
import numpy as np
9
9
10
- pytestmark = pytest .mark .skipif (REQUIREMENT_LEVEL .value < Requirements .DEV .value , reason = "This test needs higher requirements." )
10
+ pytestmark = pytest .mark .skipif (
11
+ condition = REQUIREMENT_LEVEL .value < Requirements .DEV .value and False ,
12
+ reason = "This test needs higher requirements."
13
+ )
11
14
12
15
ss = pytest .importorskip ("subsurface" , reason = "Subsurface is not installed" )
13
16
pd = pytest .importorskip ("pandas" , reason = "Pandas is not installed" )
@@ -26,22 +29,26 @@ def test_gempy_to_subsurface():
26
29
simplex_array += idx_max
27
30
idx_max = simplex_array .max () + 1
28
31
29
- id_array = [np .full (v .shape [0 ], i + 1 ) for i , v in enumerate (vertex )]
32
+ vertex_id_array = [np .full (v .shape [0 ], i + 1 ) for i , v in enumerate (vertex )]
33
+ cell_id_array = [np .full (v .shape [0 ], i + 1 ) for i , v in enumerate (simplex_list )]
30
34
31
- concatenated_id_array = np .concatenate (id_array )
35
+ concatenated_id_array = np .concatenate (vertex_id_array )
36
+ concatenated_cell_id_array = np .concatenate (cell_id_array )
37
+
32
38
meshes : ss .UnstructuredData = ss .UnstructuredData .from_array (
33
39
vertex = np .concatenate (vertex ),
34
40
cells = np .concatenate (simplex_list ),
35
- vertex_attr = pd .DataFrame ({'id' : concatenated_id_array })
41
+ vertex_attr = pd .DataFrame ({'id' : concatenated_id_array }),
42
+ cells_attr = pd .DataFrame ({'id' : concatenated_cell_id_array })
36
43
)
37
44
38
45
trisurf = ss .TriSurf (meshes )
39
46
pyvista_mesh = ss .visualization .to_pyvista_mesh (trisurf )
40
- ss .visualization .pv_plot ([pyvista_mesh ], image_2d = True )
47
+ ss .visualization .pv_plot ([pyvista_mesh ], image_2d = False )
41
48
42
49
43
50
def test_gempy_to_subsurface_II ():
44
- model : gp .data .GeoModel = gp .generate_example_model (ExampleModel .ANTICLINE , compute_model = True )
51
+ model : gp .data .GeoModel = gp .generate_example_model (ExampleModel .ANTICLINE , compute_model = True )
45
52
from gempy_engine .core .data .raw_arrays_solution import RawArraysSolution
46
53
meshes : ss .UnstructuredData = model .solutions .raw_arrays .meshes_to_subsurface ()
47
54
0 commit comments