Skip to content

Commit

Permalink
Refactor: Simplify BatchSimulate parameters by removing n_jobs
Browse files Browse the repository at this point in the history
Signed-off-by: samadpls <[email protected]>
  • Loading branch information
ntolley authored and samadpls committed Dec 3, 2024
1 parent fb0b79e commit d014b3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/howto/plot_batch_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions hnn_core/batch_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d014b3f

Please sign in to comment.