From 5f20ebda9371bb7416ae5e159b0005630370a44b Mon Sep 17 00:00:00 2001
From: Peter Swain <peter.swain@ed.ac.uk>
Date: Wed, 7 Feb 2024 15:58:51 +0000
Subject: [PATCH] fix(growth_rate): buddings is always defined

---
 growth_rate.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/growth_rate.py b/growth_rate.py
index 9b65462..a255410 100644
--- a/growth_rate.py
+++ b/growth_rate.py
@@ -99,6 +99,7 @@ def find_all_grs(
             pickle.dump(res_m, file)
         figs2pdf(str(wdirpath / dataname) + "_m.pdf")
         plt.close("all")
+    return res_b, res_m
 
 
 def find_gr(
@@ -133,6 +134,7 @@ def find_gr(
         t /= 60
     # signals to be found
     if buddings_df is None:
+        buddings = None
         signals = [
             "smoothed_volume",
             "growth_rate",
@@ -235,7 +237,7 @@ def run_parallel(t, volume, buddings_df, buddings, no_cells, config):
         # mothers
         t_batch = [t for i in range(batch_size)]
         for idx in range(0, no_cells, batch_size):
-            print(f" mother {idx:d}/{no_cells:d}")
+            print(f" mother {idx:d}/{no_cells-1:d}")
             v_batch = [volume[idx + i, :] for i in range(batch_size)]
             res_batch = pool.map(batch_GP, t_batch, v_batch)
             for ires in res_batch:
@@ -246,7 +248,7 @@ def run_parallel(t, volume, buddings_df, buddings, no_cells, config):
     else:
         # buds
         for idx in range(no_cells):
-            print(f" buds for {idx:d}/{no_cells:d}")
+            print(f" buds for {idx:d}/{no_cells-1:d}")
             ivol = volume[idx, :]
             bs = np.concatenate(([0], np.where(buddings[idx, :])[0], [t.size]))
             # get bud data
-- 
GitLab