Skip to content

Commit

Permalink
Multiple trials
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed May 14, 2019
1 parent 571251a commit e366c26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/plot_simulate_evoked.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
###############################################################################
# Now let's simulate the dipole
net = Network(params)
dpl = simulate_dipole(net, n_jobs=3)
dpl = simulate_dipole(net, n_jobs=3, n_trials=3)

###############################################################################
# and then plot it
Expand Down
9 changes: 6 additions & 3 deletions mne_neuron/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def prsimtime():

pc.gid_clear()
pc.done()
return dpl_data
dpl = Dipole(np.array(t_vec.to_python()), dpl_data)
return dpl


def simulate_dipole(net, n_trials=1, n_jobs=1):
Expand All @@ -107,8 +108,10 @@ def simulate_dipole(net, n_trials=1, n_jobs=1):
dpl: instance of Dipole
The dipole object
"""
data = Parallel(n_jobs=n_jobs)(delayed(_simulate_single_trial)(net.params)
for i in range(n_trials))
dpl = Parallel(n_jobs=n_jobs)(
delayed(_simulate_single_trial)(net.params)
for i in range(n_trials))

return dpl


Expand Down

0 comments on commit e366c26

Please sign in to comment.