From c3583b81a1900602f7a1b49a36e3f3f7d7fd5b40 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Wed, 14 Dec 2022 18:00:29 -0500 Subject: [PATCH] More help getting (3,) arrays into (1,3) form --- python/swiftest/swiftest/simulation_class.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 2241ae5c8..169bc1c0c 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -2407,6 +2407,8 @@ def input_to_array_3d(val,n=None): elif n == 1: if val.shape != (1,3) and val.shape != (3,): raise ValueError(f"Argument is an incorrect shape. Expected {(n,3)} or {(3,1)}. Got {val.shape} instead") + elif val.shape == (3,): + val = np.expand_dims(val,axis=0) elif val.shape != (n,3) or val.shape != (3,n): raise ValueError(f"Argument is an incorrect shape. Expected {(n,3)} or {(3,n)}. Got {val.shape} instead") elif val.shape == (3,n):