From 7c133894dac76f6cf6f45512de5ae144d7df68ea Mon Sep 17 00:00:00 2001 From: Nicholas Tolley <55253912+ntolley@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:26:30 +0500 Subject: [PATCH] Refactor: Simplify BatchSimulate parameters by removing n_jobs Signed-off-by: samadpls --- examples/howto/plot_batch_simulate.py | 3 +-- hnn_core/batch_simulate.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/howto/plot_batch_simulate.py b/examples/howto/plot_batch_simulate.py index c157f0751..d6c378e65 100644 --- a/examples/howto/plot_batch_simulate.py +++ b/examples/howto/plot_batch_simulate.py @@ -116,8 +116,7 @@ def summary_func(results): net = jones_2009_model(mesh_shape=(3, 3)) batch_simulation = BatchSimulate(net=net, set_params=set_params, - summary_func=summary_func, - n_trials=10) + summary_func=summary_func) simulation_results = batch_simulation.run(param_grid, n_jobs=n_jobs, combinations=False, diff --git a/hnn_core/batch_simulate.py b/hnn_core/batch_simulate.py index 424976187..9c09a5f88 100644 --- a/hnn_core/batch_simulate.py +++ b/hnn_core/batch_simulate.py @@ -266,10 +266,10 @@ def simulate_batch(self, param_combinations, n_jobs=1, with parallel_config(backend=backend): res = Parallel(n_jobs=n_jobs, verbose=verbose)( delayed(self._run_single_sim)( - params, n_jobs) for params in param_combinations) + params) for params in param_combinations) return res - def _run_single_sim(self, param_values, n_jobs=1): + def _run_single_sim(self, param_values): """Run a single simulation. Parameters