Skip to content

Commit 99c9d7e

Browse files
authored
[FIX] Use deepcopy for options and add example.mle test file (#16)
# [BUG] Fix dual contouring deepcopy and remove redundant code - Replace `copy.copy` with `copy.deepcopy` in `multi_scalar_dual_contouring.py` to ensure proper isolation of options when modifying evaluation parameters - Remove redundant case statements in `raw_arrays_solution.py` that were handling unneeded block solution types - Add example MLE file for testing server functionality ## [BUG] Dual contouring was switching compute grads on for the original geomodel object
2 parents a225a74 + 4fc4aca commit 99c9d7e

File tree

4 files changed

+1
-12
lines changed

4 files changed

+1
-12
lines changed

gempy_engine/API/dual_contouring/multi_scalar_dual_contouring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def dual_contouring_multi_scalar(data_descriptor: InputDataDescriptor, interpola
3131
octree_leaves = octree_list[-1]
3232
all_meshes: List[DualContouringMesh] = []
3333

34-
dual_contouring_options = copy.copy(options)
34+
dual_contouring_options = copy.deepcopy(options)
3535
dual_contouring_options.evaluation_options.compute_scalar_gradient = True
3636

3737
if options.debug_water_tight:

gempy_engine/core/data/raw_arrays_solution.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ def from_gempy_engine_solutions(cls, octrees_output: list[OctreeLevel], meshes:
8282
case cls.BlockSolutionType.DENSE_GRID:
8383
_fill_block_solutions_with_dense_grid(stacks_output, raw_arrays_solution)
8484
raw_arrays_solution.dense_ids = BackendTensor.t.to_numpy(collapsed_output.ids_block_dense_grid)
85-
case cls.BlockSolutionType.NONE:
86-
return None
87-
case _:
88-
raise ValueError(f"Block solution type {block_solution_type} not recognized")
89-
9085

9186
# Endregion
9287

tests/test_common/test_modules/test_dual.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,6 @@ def test_find_edges_intersection_step_by_step(simple_model, simple_grid_3d_octre
394394
xyz_on_edge, gradients, a, b, v_pro, np.array(v_mesh), indices=None,
395395
plot_label=False, plot_marching_cubes=False)
396396

397-
return xyz_on_edge, gradients
398-
399397

400398
@pytest.mark.skipif(BackendTensor.engine_backend != AvailableBackends.numpy, reason="Only numpy supported")
401399
def test_find_edges_intersection_pro(simple_model, simple_grid_3d_octree):
@@ -503,8 +501,6 @@ def test_find_edges_intersection_pro(simple_model, simple_grid_3d_octree):
503501
v_pro=v_pro, indices=indices, plot_marching_cubes=True
504502
)
505503

506-
return xyz_on_edge, gradients
507-
508504

509505
@pytest.mark.skipif(BackendTensor.engine_backend != AvailableBackends.numpy, reason="Only numpy supported")
510506
def test_find_edges_intersection_bias_on_center_of_the_cell(simple_model, simple_grid_3d_octree):
@@ -608,8 +604,6 @@ def test_find_edges_intersection_bias_on_center_of_the_cell(simple_model, simple
608604
v_pro=v_pro, indices=indices, plot_marching_cubes=True
609605
)
610606

611-
return xyz_on_edge, gradients
612-
613607

614608
# * ======================= Private functions =======================
615609

tests/test_server/example.mle

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)