Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: hnn-core compatibility #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions hnn/qt_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,22 @@ def simulate(net):

sim_data = {}
# run the simulation with MPIBackend for faster completion time
record_vsoma = bool(net.params['record_vsoma'])
record_vsoma = bool(net._params['record_vsoma'])

numspikes_params = net.params['numspikes_*']
numspikes_params = net._params['numspikes_*']
# optimization can feed in floats for numspikes
for param_name, spikes in numspikes_params.items():
net.params[param_name] = round(spikes)
net._params[param_name] = round(spikes)

sim_data['raw_dpls'] = simulate_dipole(net, net.params['N_trials'],
sim_data['raw_dpls'] = simulate_dipole(net,
n_trials=net._params['N_trials'],
postproc=False,
record_vsoma=record_vsoma)
record_vsoma=record_vsoma,
tstop=net._params['tstop'])

# hnn-core changes this to bool, change back to int
if isinstance(net.params['record_vsoma'], bool):
net.params['record_vsoma'] = int(record_vsoma)
if isinstance(net._params['record_vsoma'], bool):
net._params['record_vsoma'] = int(record_vsoma)
sim_data['gid_ranges'] = net.gid_ranges
sim_data['spikes'] = net.cell_response
sim_data['vsoma'] = net.cell_response.vsoma
Expand Down