Skip to content

Commit 184232e

Browse files
committed
change 1D too
1 parent cd7ae1a commit 184232e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/simulator/advance/test_fields_advance_1d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def test_overlaped_fields_are_equal_with_min_max_patch_size_of_max_ghosts(
6565
interp_order,
6666
refinement_boxes,
6767
"eb",
68-
smallest_patch_size=smallest_patch_size,
69-
largest_patch_size=smallest_patch_size,
68+
smallest_patch_size=smallest_patch_size + 1,
69+
largest_patch_size=smallest_patch_size + 1,
7070
time_step=time_step,
7171
time_step_nbr=time_step_nbr,
7272
)

tests/simulator/test_advance.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ def base_test_overlaped_fields_are_equal(self, datahier, coarsest_time):
290290
import matplotlib.pyplot as plt
291291
from matplotlib.patches import Rectangle
292292

293+
if box.ndim == 1:
294+
failed_i = np.where(np.abs(slice1 - slice2) > 5.5e-15)
295+
293296
if box.ndim == 2:
294297
failed_i, failed_j = np.where(
295298
np.abs(slice1 - slice2) > 5.5e-15
@@ -348,7 +351,10 @@ def makerec(
348351
f"pd2 ghost box {pd2.ghost_box} (shape {pd2.ghost_box.shape}) and box {pd2.box} (shape {pd2.box.shape})"
349352
)
350353
print("interp_order: ", pd1.layout.interp_order)
351-
print(f"failing cells: {failed_i}, {failed_j}")
354+
if box.ndim == 1:
355+
print(f"failing cells: {failed_i})
356+
elif box.ndim == 2:
357+
print(f"failing cells: {failed_i}, {failed_j}")
352358
print(coarsest_time)
353359
# if self.rethrow_:
354360
# raise e

0 commit comments

Comments
 (0)