From c696b4aa1e509b6485f7468cc5de5b389322dded Mon Sep 17 00:00:00 2001 From: pswain <peter.swain@ed.ac.uk> Date: Tue, 6 Feb 2024 14:48:41 +0000 Subject: [PATCH] refactor(run_gr): renamed batch to multiprocess --- examples/run_gr.py | 8 ++++---- growth_rate.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/run_gr.py b/examples/run_gr.py index 61f60c7..159dbca 100644 --- a/examples/run_gr.py +++ b/examples/run_gr.py @@ -14,11 +14,11 @@ datasets = [ # 1. It is better to run dataloader first to generate a tsv file. # Alternatively, to run directly on h5 files, add use_tsv=False. -# 2. First run with run_GP = True, batch=False, and max_no_cells = 20 +# 2. First run with run_GP = True, multiprocess=False, and max_no_cells = 20 # to check visually the results. -# 3. Then run with max_no_cells=None and batch=True for multiprocessing. +# 3. Then run with max_no_cells=None and multiprocess=True for multiprocessing. # The results are saved in a pkl file. -# No figures are produced unless batch=False. +# No figures are produced unless multiprocess=False. # Any figures are saved in a pdf file. # 4. Finally run with run_GP = False. # This load the pkl file and integrates into dataloader's data frame. @@ -32,7 +32,7 @@ for dataname in datasets: dataname, max_no_cells=20, wdir=wdir, - batch=False, + multiprocess=False, convert_to_hours=False, mother_bounds={1: (1, 6), 2: (-1, 4)}, ) diff --git a/growth_rate.py b/growth_rate.py index 885048c..9b65462 100644 --- a/growth_rate.py +++ b/growth_rate.py @@ -20,7 +20,7 @@ def find_all_grs( use_tsv=True, bud_bounds=None, mother_bounds=None, - batch=False, + multiprocess=False, convert_to_hours=True, ): """ @@ -45,7 +45,7 @@ def find_all_grs( mother_bounds: dict, optional To change bounds on the hyperparameters for the Gaussian process applied to mothers. - batch: boolean, optional + multiprocess: boolean, optional If True, use multiprocessing, but no plots are then produced. convert_to_hours: boolean If True, divide time values by 60. @@ -78,7 +78,7 @@ def find_all_grs( buddings, max_no_cells=max_no_cells, bounds=bud_bounds, - batch=batch, + multiprocess=multiprocess, convert_to_hours=convert_to_hours, ) if save: @@ -91,7 +91,7 @@ def find_all_grs( m_vol, max_no_cells=max_no_cells, bounds=mother_bounds, - batch=batch, + multiprocess=multiprocess, convert_to_hours=convert_to_hours, ) if save: @@ -107,7 +107,7 @@ def find_gr( bounds=None, noruns=10, verbose=True, - batch=False, + multiprocess=False, max_no_cells=None, convert_to_hours=True, ): @@ -158,9 +158,9 @@ def find_gr( else: no_cells = volume.shape[0] # loop over cells - if batch: + if multiprocess: config["verbose"] = False - res = run_batch(t, volume, buddings_df, buddings, no_cells, config) + res = run_parallel(t, volume, buddings_df, buddings, no_cells, config) else: res = run_series(t, volume, buddings_df, buddings, no_cells, config) # convert results into dataframes @@ -215,7 +215,7 @@ def run_series(t, volume, buddings_df, buddings, no_cells, config): return res -def run_batch(t, volume, buddings_df, buddings, no_cells, config): +def run_parallel(t, volume, buddings_df, buddings, no_cells, config): """ Use multiprocessing to speed GPs. -- GitLab