Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[TEST] Fixing tests
  • Loading branch information
Leguark committed May 25, 2025
commit 2c6dd68d6b97a0fa406105896acd1faf2b28c19f
1 change: 1 addition & 0 deletions requirements/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pytest
pyvista
subsurface-terra
wellpathpy

# Testing
pytest-approvaltests
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"meta": {
"name": "Model1",
"creation_date": "<DATE_IGNORED>",
"last_modification_date": null,
"owner": null
},
"structural_frame": {
"structural_groups": [
{
"name": "Fault1",
"elements": [
{
"name": "fault1",
"is_active": true,
"_color": "#728f02",
"surface_points": {
"name_id_map": {
"fault1": 26244822
},
"_model_transform": null
},
"orientations": {
"name_id_map": {
"fault1": 26244822
},
"_model_transform": null
},
"scalar_field_at_interface": null,
"_id": -1
}
],
"structural_relation": 3,
"fault_relations": 3,
"faults_input_data": null,
"solution": null
},
{
"name": "default_formations",
"elements": [
{
"name": "surface1",
"is_active": true,
"_color": "#015482",
"surface_points": {
"name_id_map": {},
"_model_transform": null
},
"orientations": {
"name_id_map": null,
"_model_transform": null
},
"scalar_field_at_interface": null,
"_id": -1
},
{
"name": "surface2",
"is_active": true,
"_color": "#9f0052",
"surface_points": {
"name_id_map": {
"surface2": 21816406
},
"_model_transform": null
},
"orientations": {
"name_id_map": null,
"_model_transform": null
},
"scalar_field_at_interface": null,
"_id": -1
},
{
"name": "surface3",
"is_active": true,
"_color": "#ffbe00",
"surface_points": {
"name_id_map": {
"surface3": 98435767
},
"_model_transform": null
},
"orientations": {
"name_id_map": null,
"_model_transform": null
},
"scalar_field_at_interface": null,
"_id": -1
}
],
"structural_relation": 1,
"fault_relations": null,
"faults_input_data": null,
"solution": null
}
],
"is_dirty": true,
"basement_color": "#443988",
"binary_meta_data": {
"sp_binary_length": 360
}
},
"grid": {
"_octree_grid": null,
"_dense_grid": {
"resolution": [
50,
50,
50
],
"extent": [
0.0,
791.0,
-200.0,
200.0,
-582.0,
0.0
],
"_transform": null
},
"_custom_grid": null,
"_topography": {
"_regular_grid": {
"resolution": [
50,
50,
50
],
"extent": [
0.0,
791.0,
-200.0,
200.0,
-582.0,
0.0
],
"_transform": null
},
"source": null,
"values": [],
"resolution": [
0,
0
],
"raster_shape": [],
"_mask_topo": null,
"_x": null,
"_y": null
},
"_sections": null,
"_centered_grid": null,
"_transform": null,
"_octree_levels": -1,
"active_grids": 1034
},
"geophysics_input": null,
"input_transform": {
"position": [
-417.5,
-0.5,
157.0
],
"rotation": [
0.0,
0.0,
0.0
],
"scale": [
0.0012853470437017994,
0.0012853470437017994,
0.0012853470437017994
],
"_is_default_transform": false,
"_cached_pivot": null
},
"_interpolation_options": {
"kernel_options": {
"range": 1.7,
"c_o": 10.0,
"uni_degree": 1,
"i_res": 4.0,
"gi_res": 2.0,
"number_dimensions": 3,
"kernel_function": "cubic",
"kernel_solver": 1,
"compute_condition_number": false,
"optimizing_condition_number": false,
"condition_number": null
},
"evaluation_options": {
"_number_octree_levels": 1,
"_number_octree_levels_surface": 4,
"octree_curvature_threshold": -1.0,
"octree_error_threshold": 1.0,
"octree_min_level": 2,
"mesh_extraction": true,
"mesh_extraction_masking_options": 3,
"mesh_extraction_fancy": true,
"evaluation_chunk_size": 500000,
"compute_scalar_gradient": false,
"verbose": false
},
"debug": true,
"cache_mode": 3,
"cache_model_name": "Model1",
"block_solutions_type": 2,
"sigmoid_slope": 5000000,
"debug_water_tight": false
}
}
4 changes: 3 additions & 1 deletion test/test_modules/test_serialize_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def test_generate_horizontal_stratigraphic_model():
f.write(model_json)

with loading_model_from_binary(
binary_body=model.structural_frame.input_tables_binary
input_binary=model.structural_frame.input_tables_binary,
grid_binary=model.grid.grid_binary
# binary_body=model.structural_frame.input_tables_binary
):
model_deserialized = gp.data.GeoModel.model_validate_json(model_json)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@
],
"is_dirty": true,
"basement_color": "#ffbe00",
"_input_binary_size": 0,
"binary_meta_data": {
"sp_binary_length": 432
"sp_binary_length": 432,
"ori_binary_length": 120,
"input_binary_size": 0
}
},
"grid": {
Expand All @@ -89,6 +92,12 @@
"_centered_grid": null,
"_transform": null,
"_octree_levels": -1,
"_grid_binary_size": 0,
"binary_meta_data": {
"custom_grid_binary_length": 0,
"topography_binary_length": 0,
"grid_binary_size": 0
},
"active_grids": 1026
},
"geophysics_input": null,
Expand Down