Skip to content

Commit 2c6dd68

Browse files
committed
[TEST] Fixing tests
1 parent bce3ee6 commit 2c6dd68

File tree

4 files changed

+224
-2
lines changed

4 files changed

+224
-2
lines changed

requirements/dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
pytest
44
pyvista
55
subsurface-terra
6+
wellpathpy
67

78
# Testing
89
pytest-approvaltests
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
{
2+
"meta": {
3+
"name": "Model1",
4+
"creation_date": "<DATE_IGNORED>",
5+
"last_modification_date": null,
6+
"owner": null
7+
},
8+
"structural_frame": {
9+
"structural_groups": [
10+
{
11+
"name": "Fault1",
12+
"elements": [
13+
{
14+
"name": "fault1",
15+
"is_active": true,
16+
"_color": "#728f02",
17+
"surface_points": {
18+
"name_id_map": {
19+
"fault1": 26244822
20+
},
21+
"_model_transform": null
22+
},
23+
"orientations": {
24+
"name_id_map": {
25+
"fault1": 26244822
26+
},
27+
"_model_transform": null
28+
},
29+
"scalar_field_at_interface": null,
30+
"_id": -1
31+
}
32+
],
33+
"structural_relation": 3,
34+
"fault_relations": 3,
35+
"faults_input_data": null,
36+
"solution": null
37+
},
38+
{
39+
"name": "default_formations",
40+
"elements": [
41+
{
42+
"name": "surface1",
43+
"is_active": true,
44+
"_color": "#015482",
45+
"surface_points": {
46+
"name_id_map": {},
47+
"_model_transform": null
48+
},
49+
"orientations": {
50+
"name_id_map": null,
51+
"_model_transform": null
52+
},
53+
"scalar_field_at_interface": null,
54+
"_id": -1
55+
},
56+
{
57+
"name": "surface2",
58+
"is_active": true,
59+
"_color": "#9f0052",
60+
"surface_points": {
61+
"name_id_map": {
62+
"surface2": 21816406
63+
},
64+
"_model_transform": null
65+
},
66+
"orientations": {
67+
"name_id_map": null,
68+
"_model_transform": null
69+
},
70+
"scalar_field_at_interface": null,
71+
"_id": -1
72+
},
73+
{
74+
"name": "surface3",
75+
"is_active": true,
76+
"_color": "#ffbe00",
77+
"surface_points": {
78+
"name_id_map": {
79+
"surface3": 98435767
80+
},
81+
"_model_transform": null
82+
},
83+
"orientations": {
84+
"name_id_map": null,
85+
"_model_transform": null
86+
},
87+
"scalar_field_at_interface": null,
88+
"_id": -1
89+
}
90+
],
91+
"structural_relation": 1,
92+
"fault_relations": null,
93+
"faults_input_data": null,
94+
"solution": null
95+
}
96+
],
97+
"is_dirty": true,
98+
"basement_color": "#443988",
99+
"binary_meta_data": {
100+
"sp_binary_length": 360
101+
}
102+
},
103+
"grid": {
104+
"_octree_grid": null,
105+
"_dense_grid": {
106+
"resolution": [
107+
50,
108+
50,
109+
50
110+
],
111+
"extent": [
112+
0.0,
113+
791.0,
114+
-200.0,
115+
200.0,
116+
-582.0,
117+
0.0
118+
],
119+
"_transform": null
120+
},
121+
"_custom_grid": null,
122+
"_topography": {
123+
"_regular_grid": {
124+
"resolution": [
125+
50,
126+
50,
127+
50
128+
],
129+
"extent": [
130+
0.0,
131+
791.0,
132+
-200.0,
133+
200.0,
134+
-582.0,
135+
0.0
136+
],
137+
"_transform": null
138+
},
139+
"source": null,
140+
"values": [],
141+
"resolution": [
142+
0,
143+
0
144+
],
145+
"raster_shape": [],
146+
"_mask_topo": null,
147+
"_x": null,
148+
"_y": null
149+
},
150+
"_sections": null,
151+
"_centered_grid": null,
152+
"_transform": null,
153+
"_octree_levels": -1,
154+
"active_grids": 1034
155+
},
156+
"geophysics_input": null,
157+
"input_transform": {
158+
"position": [
159+
-417.5,
160+
-0.5,
161+
157.0
162+
],
163+
"rotation": [
164+
0.0,
165+
0.0,
166+
0.0
167+
],
168+
"scale": [
169+
0.0012853470437017994,
170+
0.0012853470437017994,
171+
0.0012853470437017994
172+
],
173+
"_is_default_transform": false,
174+
"_cached_pivot": null
175+
},
176+
"_interpolation_options": {
177+
"kernel_options": {
178+
"range": 1.7,
179+
"c_o": 10.0,
180+
"uni_degree": 1,
181+
"i_res": 4.0,
182+
"gi_res": 2.0,
183+
"number_dimensions": 3,
184+
"kernel_function": "cubic",
185+
"kernel_solver": 1,
186+
"compute_condition_number": false,
187+
"optimizing_condition_number": false,
188+
"condition_number": null
189+
},
190+
"evaluation_options": {
191+
"_number_octree_levels": 1,
192+
"_number_octree_levels_surface": 4,
193+
"octree_curvature_threshold": -1.0,
194+
"octree_error_threshold": 1.0,
195+
"octree_min_level": 2,
196+
"mesh_extraction": true,
197+
"mesh_extraction_masking_options": 3,
198+
"mesh_extraction_fancy": true,
199+
"evaluation_chunk_size": 500000,
200+
"compute_scalar_gradient": false,
201+
"verbose": false
202+
},
203+
"debug": true,
204+
"cache_mode": 3,
205+
"cache_model_name": "Model1",
206+
"block_solutions_type": 2,
207+
"sigmoid_slope": 5000000,
208+
"debug_water_tight": false
209+
}
210+
}

test/test_modules/test_serialize_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def test_generate_horizontal_stratigraphic_model():
2424
f.write(model_json)
2525

2626
with loading_model_from_binary(
27-
binary_body=model.structural_frame.input_tables_binary
27+
input_binary=model.structural_frame.input_tables_binary,
28+
grid_binary=model.grid.grid_binary
29+
# binary_body=model.structural_frame.input_tables_binary
2830
):
2931
model_deserialized = gp.data.GeoModel.model_validate_json(model_json)
3032

test/test_modules/test_serialize_model.test_generate_horizontal_stratigraphic_model.verify/Horizontal Stratigraphic Model serialization.approved.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@
6161
],
6262
"is_dirty": true,
6363
"basement_color": "#ffbe00",
64+
"_input_binary_size": 0,
6465
"binary_meta_data": {
65-
"sp_binary_length": 432
66+
"sp_binary_length": 432,
67+
"ori_binary_length": 120,
68+
"input_binary_size": 0
6669
}
6770
},
6871
"grid": {
@@ -89,6 +92,12 @@
8992
"_centered_grid": null,
9093
"_transform": null,
9194
"_octree_levels": -1,
95+
"_grid_binary_size": 0,
96+
"binary_meta_data": {
97+
"custom_grid_binary_length": 0,
98+
"topography_binary_length": 0,
99+
"grid_binary_size": 0
100+
},
92101
"active_grids": 1026
93102
},
94103
"geophysics_input": null,

0 commit comments

Comments
 (0)