From 122ba3960537d07ae2643541d5d8c547d44acc1e Mon Sep 17 00:00:00 2001 From: nimounet Date: Fri, 21 Jun 2024 09:48:52 +0200 Subject: [PATCH] Improving (speed-up) mix_fine_and_rough_sampling implementatoin in component.py --- xwakes/wit/component.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xwakes/wit/component.py b/xwakes/wit/component.py index 89704089..8da79d90 100644 --- a/xwakes/wit/component.py +++ b/xwakes/wit/component.py @@ -26,11 +26,10 @@ def mix_fine_and_rough_sampling(start: float, stop: float, rough_points: int, intervals = [np.linspace(max(i, start), min(f, stop), fine_points) for i, f in rois if (start <= i <= stop or start <= f <= stop)] - fine_sampling_rois = np.hstack(intervals) if intervals else np.array([]) rough_sampling = np.geomspace(start, stop, rough_points) return unique_sigfigs( - np.sort(np.concatenate((fine_sampling_rois, rough_sampling))), 7) + np.sort(np.hstack((*intervals, rough_sampling)),kind='stable'), 7) class Component: