From e3024b2f7ac56380de6ff89e3f5b73b74a4caf5b Mon Sep 17 00:00:00 2001 From: xiyehu2 <35537592+xiyehu2@users.noreply.github.com> Date: Fri, 13 Jan 2023 16:17:06 -0600 Subject: [PATCH] added skipping case consideration in get_rearrange_paths --- Python/waveform.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/waveform.py b/Python/waveform.py index 7cbbb11..0097726 100644 --- a/Python/waveform.py +++ b/Python/waveform.py @@ -3,7 +3,7 @@ from typing import Dict, Tuple, Any, List import numpy as np from scipy.interpolate import interp1d from AWG import * -import cupy as cp +# import cupy as cp import scipy.optimize as spopt @@ -319,6 +319,8 @@ def get_rearrange_paths( :param t_idx: indices of tweezer positions in target pattern. :returns: 2d numpy array containing moving path trajectories """ + if len(f_idx) < len(t_idx): + return np.array([]) cm = abs(np.subtract.outer(f_idx, t_idx)) row, col = spopt.linear_sum_assignment(cm) return np.stack([f_idx[row], t_idx]).T -- GitLab