From 63f49acc9be6b7696b073fdb1b0a1413d63c4891 Mon Sep 17 00:00:00 2001 From: Mohammed Saqib Date: Thu, 29 Sep 2022 17:08:07 -0400 Subject: [PATCH] added fix for dwell time --- dyconnmap/chronnectomics/dwell_time.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dyconnmap/chronnectomics/dwell_time.py b/dyconnmap/chronnectomics/dwell_time.py index e8615e7..f3effb3 100644 --- a/dyconnmap/chronnectomics/dwell_time.py +++ b/dyconnmap/chronnectomics/dwell_time.py @@ -50,6 +50,12 @@ def dwell_time(x): r_diff = np.diff(r) r_diff_without_one = np.where(r_diff != 1) + + if r_diff_without_one[0].shape[0] == 0: + dwell[symbol] = [] + dwell_mean[symbol] = 0 + dwell_std[symbol] = 0 + continue x = r[r_diff_without_one] segments = len(x)