From b4e6672016e36ac5feb921f803ba9e35d355fa15 Mon Sep 17 00:00:00 2001 From: KRiedmiller Date: Thu, 25 Jun 2026 11:29:30 +0200 Subject: [PATCH] test: add simple test cases for find_patch_and_halo_shapes --- tests/functionals/prediction/test_size_finder.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/functionals/prediction/test_size_finder.py b/tests/functionals/prediction/test_size_finder.py index 310dfd32..dcbe7cbf 100644 --- a/tests/functionals/prediction/test_size_finder.py +++ b/tests/functionals/prediction/test_size_finder.py @@ -1,5 +1,6 @@ import os +import numpy as np import pytest import torch @@ -90,6 +91,9 @@ (100, 100, 100), ((192, 192, 192), (0, 0, 0)), ), + ((16, 8, 8), (10, 10, 10), (4, 4, 4), ((7, 8, 8), (4, 0, 0))), + ((16, 10, 10), (10, 10, 10), (4, 4, 4), ((2, 2, 2), (4, 4, 4))), + ((12, 12, 8), (10, 10, 10), (4, 4, 4), ((3, 3, 8), (4, 4, 0))), ], ) def test_find_patch_and_halo_shapes( @@ -99,6 +103,10 @@ def test_find_patch_and_halo_shapes( full_volume_shape, max_patch_shape, min_halo_shape ) assert result == expected + + double_halo_out = np.array(result[1]) * 2 + assert np.prod(result[0] + double_halo_out) <= np.prod(max_patch_shape) + double_halo_shape = ( min_halo_shape[0] * 2, min_halo_shape[1] * 2,