From 2022652be718e7241f6b088d54c64d249527a0a2 Mon Sep 17 00:00:00 2001 From: ancestor-mithril <sgeorge.sstoica99@gmail.com> Date: Fri, 12 Jul 2024 14:58:29 +0300 Subject: [PATCH] Updated the random direction from tests to start with -1 --- tests/utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 1363eae..ef40100 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -6,13 +6,10 @@ def create_random_volume(high=5, size=(22, 21, 20), random_direction=False, dtyp x = np.random.randint(low=0, high=high, size=size, dtype=dtype) spacing = (1, 1, 1) origin = (0, 0, 0) - default_direction = (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) if random_direction: - direction = tuple(np.random.uniform(low=-1.0, high=1.0, size=(9,))) - if direction == default_direction: - direction = (-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0) + direction = (-1, *np.random.uniform(low=-1.0, high=1.0, size=(8,))) else: - direction = default_direction + direction = (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) return x, spacing, origin, direction