Skip to content

Commit 4fc3bf1

Browse files
committed
Update test including timing for compute_at.
1 parent 18a4132 commit 4fc3bf1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

test/test_modules/test_compute_at_computation_time.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,19 @@ def test_compute_at_computation_time():
5656
end_time = time.perf_counter()
5757
computation_time_topo = end_time - start_time
5858

59-
print(f"Computation time without topography: {computation_time_model:.2f} seconds")
60-
print(f"Computation time with topography: {computation_time_topo:.2f} seconds")
59+
# numpy array with random coordinates within the extent of the model
60+
custom_coordinates = np.random.uniform(
61+
low=geo_model.grid.extent[:3],
62+
high=geo_model.grid.extent[3:],
63+
size=(1000, 3)
64+
)
65+
66+
start_time = time.perf_counter()
67+
gp.compute_model_at(geo_model, custom_coordinates)
68+
end_time = time.perf_counter()
69+
computation_time_at = end_time - start_time
70+
71+
print(f"Computation only model dense grid 125*50*50: {computation_time_model:.2f} seconds")
72+
print(f"Computation time with topography 125*50: {computation_time_topo:.2f} seconds")
73+
print(f"Computation compute_at with 1000 custom points: {computation_time_at:.2f} seconds")
74+

0 commit comments

Comments
 (0)