diff --git a/forest/jasmine/data2mobmat.py b/forest/jasmine/data2mobmat.py index 1818bef2..a93d8c64 100644 --- a/forest/jasmine/data2mobmat.py +++ b/forest/jasmine/data2mobmat.py @@ -1004,7 +1004,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)