From 4d31d0714d61373b6de67850df52cf84181998ad Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Tue, 7 Jan 2025 23:49:03 +0530 Subject: [PATCH] Calculate velocity if not specified in sim object --- tardis/visualization/tools/visualization_data.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tardis/visualization/tools/visualization_data.py b/tardis/visualization/tools/visualization_data.py index 02870ad4787..46aa05ae746 100644 --- a/tardis/visualization/tools/visualization_data.py +++ b/tardis/visualization/tools/visualization_data.py @@ -101,17 +101,9 @@ def __init__( self.v_inner = v_inner self.v_outer = v_outer - # First check if both options are provided - if velocity is not None and (v_inner is not None or v_outer is not None): - raise ValueError( - "Cannot specify both velocity and (v_inner, v_outer). " - "Please provide either velocity OR the (v_inner, v_outer) pair." - ) - if velocity is not None: self.velocity = velocity - - if v_inner is not None and v_outer is not None: + else: self.velocity = pd.concat( [v_inner, pd.Series([v_outer.iloc[-1]])], ignore_index=True ).tolist() * (u.cm / u.s)