Skip to content
Snippets Groups Projects
Commit c696b4aa authored by pswain's avatar pswain
Browse files

refactor(run_gr): renamed batch to multiprocess

parent be617ffb
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,11 @@ datasets = [ ...@@ -14,11 +14,11 @@ datasets = [
# 1. It is better to run dataloader first to generate a tsv file. # 1. It is better to run dataloader first to generate a tsv file.
# Alternatively, to run directly on h5 files, add use_tsv=False. # 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. # 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. # 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. # Any figures are saved in a pdf file.
# 4. Finally run with run_GP = False. # 4. Finally run with run_GP = False.
# This load the pkl file and integrates into dataloader's data frame. # This load the pkl file and integrates into dataloader's data frame.
...@@ -32,7 +32,7 @@ for dataname in datasets: ...@@ -32,7 +32,7 @@ for dataname in datasets:
dataname, dataname,
max_no_cells=20, max_no_cells=20,
wdir=wdir, wdir=wdir,
batch=False, multiprocess=False,
convert_to_hours=False, convert_to_hours=False,
mother_bounds={1: (1, 6), 2: (-1, 4)}, mother_bounds={1: (1, 6), 2: (-1, 4)},
) )
......
...@@ -20,7 +20,7 @@ def find_all_grs( ...@@ -20,7 +20,7 @@ def find_all_grs(
use_tsv=True, use_tsv=True,
bud_bounds=None, bud_bounds=None,
mother_bounds=None, mother_bounds=None,
batch=False, multiprocess=False,
convert_to_hours=True, convert_to_hours=True,
): ):
""" """
...@@ -45,7 +45,7 @@ def find_all_grs( ...@@ -45,7 +45,7 @@ def find_all_grs(
mother_bounds: dict, optional mother_bounds: dict, optional
To change bounds on the hyperparameters for the Gaussian process To change bounds on the hyperparameters for the Gaussian process
applied to mothers. applied to mothers.
batch: boolean, optional multiprocess: boolean, optional
If True, use multiprocessing, but no plots are then produced. If True, use multiprocessing, but no plots are then produced.
convert_to_hours: boolean convert_to_hours: boolean
If True, divide time values by 60. If True, divide time values by 60.
...@@ -78,7 +78,7 @@ def find_all_grs( ...@@ -78,7 +78,7 @@ def find_all_grs(
buddings, buddings,
max_no_cells=max_no_cells, max_no_cells=max_no_cells,
bounds=bud_bounds, bounds=bud_bounds,
batch=batch, multiprocess=multiprocess,
convert_to_hours=convert_to_hours, convert_to_hours=convert_to_hours,
) )
if save: if save:
...@@ -91,7 +91,7 @@ def find_all_grs( ...@@ -91,7 +91,7 @@ def find_all_grs(
m_vol, m_vol,
max_no_cells=max_no_cells, max_no_cells=max_no_cells,
bounds=mother_bounds, bounds=mother_bounds,
batch=batch, multiprocess=multiprocess,
convert_to_hours=convert_to_hours, convert_to_hours=convert_to_hours,
) )
if save: if save:
...@@ -107,7 +107,7 @@ def find_gr( ...@@ -107,7 +107,7 @@ def find_gr(
bounds=None, bounds=None,
noruns=10, noruns=10,
verbose=True, verbose=True,
batch=False, multiprocess=False,
max_no_cells=None, max_no_cells=None,
convert_to_hours=True, convert_to_hours=True,
): ):
...@@ -158,9 +158,9 @@ def find_gr( ...@@ -158,9 +158,9 @@ def find_gr(
else: else:
no_cells = volume.shape[0] no_cells = volume.shape[0]
# loop over cells # loop over cells
if batch: if multiprocess:
config["verbose"] = False 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: else:
res = run_series(t, volume, buddings_df, buddings, no_cells, config) res = run_series(t, volume, buddings_df, buddings, no_cells, config)
# convert results into dataframes # convert results into dataframes
...@@ -215,7 +215,7 @@ def run_series(t, volume, buddings_df, buddings, no_cells, config): ...@@ -215,7 +215,7 @@ def run_series(t, volume, buddings_df, buddings, no_cells, config):
return res 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. Use multiprocessing to speed GPs.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment