Skip to content

Commit

Permalink
Calculate velocity if not specified in sim object
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Jan 7, 2025
1 parent 24fb361 commit 4d31d07
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tardis/visualization/tools/visualization_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4d31d07

Please sign in to comment.