Skip to content

Commit 3dadf4b

Browse files
committed
[BUG-ish] Getting gempy_engine tests running
1 parent fb44c9a commit 3dadf4b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

gempy_engine/API/interp_single/_octree_generation.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,21 @@
1818

1919
def interpolate_on_octree(interpolation_input: InterpolationInput, options: InterpolationOptions,
2020
data_shape: InputDataDescriptor) -> OctreeLevel:
21+
2122
if BackendTensor.engine_backend is not AvailableBackends.PYTORCH and COMPUTE_GRADIENTS is False:
22-
interpolation_input = copy.deepcopy(interpolation_input)
23+
temp_interpolation_input = copy.deepcopy(interpolation_input)
2324

2425
# * Interpolate - centers
25-
output_0_centers: List[InterpOutput] = interpolate_all_fields(interpolation_input, options, data_shape) # interpolate - centers
26+
output_0_centers: List[InterpOutput] = interpolate_all_fields(temp_interpolation_input, options, data_shape) # interpolate - centers
2627

2728
# * Interpolate - corners
28-
grid_0_centers: Grid = interpolation_input.grid # ? This could be moved to the next section
29+
grid_0_centers: Grid = temp_interpolation_input.grid # ? This could be moved to the next section
2930
if options.compute_corners:
3031
grid_0_corners = Grid.from_xyz_coords(
3132
xyz_coords=_generate_corners(regular_grid=grid_0_centers.regular_grid)
3233
)
33-
interpolation_input.grid = grid_0_corners # * Prepare grid for next interpolation
34-
output_0_corners: List[InterpOutput] = interpolate_all_fields(interpolation_input, options, data_shape) # * This is unnecessary for the last level except for Dual contouring
34+
temp_interpolation_input.grid = grid_0_corners # * Prepare grid for next interpolation
35+
output_0_corners: List[InterpOutput] = interpolate_all_fields(temp_interpolation_input, options, data_shape) # * This is unnecessary for the last level except for Dual contouring
3536
else:
3637
output_0_corners = []
3738
grid_0_corners = None

gempy_engine/API/model/model_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ def compute_model(interpolation_input: InterpolationInput, options: Interpolatio
2525

2626
# TODO: Make sure if this works with TF
2727
# ! If we inline this it seems the deepcopy does not work
28-
29-
if BackendTensor.engine_backend is AvailableBackends.PYTORCH and COMPUTE_GRADIENTS is False:
28+
if BackendTensor.engine_backend is not AvailableBackends.PYTORCH and COMPUTE_GRADIENTS is False:
3029
interpolation_input = copy.deepcopy(interpolation_input)
3130

3231
output: list[OctreeLevel] = interpolate_n_octree_levels(

tests/test_common/test_modules/test_geophysics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_gravity(simple_model_interpolation_input, n_oct_levels=3):
5151

5252
print(solutions.gravity)
5353

54-
if plot_pyvista or True:
54+
if plot_pyvista or False:
5555
pv.global_theme.show_edges = True
5656
p = pv.Plotter()
5757
plot_octree_pyvista(p, solutions.octrees_output, n_oct_levels -1)

0 commit comments

Comments
 (0)