From a580fe5ec63a5a3dc8775ba341a0e30dc82aa314 Mon Sep 17 00:00:00 2001 From: chemicalfiend Date: Thu, 30 May 2024 22:55:57 +0530 Subject: [PATCH] Raises an exception if all carriers are discarded --- morphct/kmc_analyze.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/morphct/kmc_analyze.py b/morphct/kmc_analyze.py index 6674f79..02e7a55 100644 --- a/morphct/kmc_analyze.py +++ b/morphct/kmc_analyze.py @@ -92,6 +92,10 @@ def get_times_msds(carrier_data): time_stderr.append(np.std(actual_times[lt]) / len(actual_times[lt])) msds.append(np.average(disps)) msd_stderr.append(np.std(disps) / len(disps)) + + if len(times) == 0: + raise Exception(f"All carrier data has been discarded. Re-check the input.") + return times, msds, time_stderr, msd_stderr