From 07b2702437bf01f96131d63c8a29948c24a40f89 Mon Sep 17 00:00:00 2001 From: GeorgiosEfstathiadis <54844705+GeorgeEfstathiadis@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:39:47 -0500 Subject: [PATCH] add check if no new pauses to concatenate (#238) --- forest/jasmine/data2mobmat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forest/jasmine/data2mobmat.py b/forest/jasmine/data2mobmat.py index da282397..31ceaf95 100644 --- a/forest/jasmine/data2mobmat.py +++ b/forest/jasmine/data2mobmat.py @@ -1000,7 +1000,8 @@ def infer_mobmat(mobmat: np.ndarray, interval: float, r: float) -> np.ndarray: (mobmat, np.ones(n_rows).reshape(n_rows, 1)) ) # Append new pauses to the trajectory matrix - mobmat = np.vstack((mobmat, new_pauses_array)) + if new_pauses_array.shape[0] > 0: + mobmat = np.vstack((mobmat, new_pauses_array)) # Sort the matrix by start time mobmat = mobmat[mobmat[:, 3].argsort()].astype(float)