-
Notifications
You must be signed in to change notification settings - Fork 52
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: Add dipole recording for individual cells #682
base: master
Are you sure you want to change the base?
Changes from all commits
adffb77
0b120fc
4345cad
276e802
da91881
05ab75d
95ff6ce
2de40b6
39dc47b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,10 @@ def simulation_time(): | |
isec_py[gid][sec_name] = { | ||
key: isec.to_python() for key, isec in isec.items()} | ||
|
||
dcell_py = dict() | ||
for gid, dcell in neuron_net._dcell.items(): | ||
dcell_py[gid] = dcell.to_python() | ||
|
||
dpl_data = np.c_[ | ||
neuron_net._nrn_dipoles['L2_pyramidal'].as_numpy() + | ||
neuron_net._nrn_dipoles['L5_pyramidal'].as_numpy(), | ||
|
@@ -119,6 +123,7 @@ def simulation_time(): | |
'gid_ranges': net.gid_ranges, | ||
'vsec': vsec_py, | ||
'isec': isec_py, | ||
'dcell': dcell_py, | ||
'rec_data': rec_arr_py, | ||
'rec_times': rec_times_py, | ||
'times': times.to_python()} | ||
|
@@ -291,6 +296,7 @@ def __init__(self, net, trial_idx=0): | |
|
||
self._vsec = dict() | ||
self._isec = dict() | ||
self._dcell = dict() | ||
self._nrn_rec_arrays = dict() | ||
self._nrn_rec_callbacks = list() | ||
|
||
|
@@ -562,6 +568,9 @@ def aggregate_data(self, n_samples): | |
nrn_dpl = self._nrn_dipoles[_long_name(cell.name)] | ||
nrn_dpl.add(cell.dipole) | ||
|
||
if self.net._params['record_dcell']: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay so you may have opened a pandora's box. If you want to go down that road, we can provide There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about I switch this to a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @jasmainak: cell-level dipoles should be accessible to the user via a similar API as other cell-level outputs. @ntolley, WDYT of hashing out an improved simulated_dipole API with existing features first in a separate MAINT PR and keep this an ENH PR. I'm imagining this getting super huge and unwieldy.... |
||
self._dcell[cell.gid] = cell.dipole | ||
|
||
self._vsec[cell.gid] = cell.vsec | ||
self._isec[cell.gid] = cell.isec | ||
|
||
|
@@ -574,6 +583,7 @@ def aggregate_data(self, n_samples): | |
# aggregate the currents and voltages independently on each proc | ||
vsec_list = _PC.py_gather(self._vsec, 0) | ||
isec_list = _PC.py_gather(self._isec, 0) | ||
dcell_list = _PC.py_gather(self._dcell, 0) | ||
|
||
# combine spiking data from each proc | ||
spike_times_list = _PC.py_gather(self._spike_times, 0) | ||
|
@@ -589,6 +599,8 @@ def aggregate_data(self, n_samples): | |
self._vsec.update(vsec) | ||
for isec in isec_list: | ||
self._isec.update(isec) | ||
for dcell in dcell_list: | ||
self._dcell.update(dcell) | ||
|
||
_PC.barrier() # get all nodes to this place before continuing | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a computational hit when you do this? I think users should be warned ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is, it is substantially less than
record_isec
andrecord_vsec
because the individual cell dipoles have to be recorded by default. The only difference here is that we save them at the end instead of just adding them together.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With that said I personally haven't noticed a performance hit (will need to followup with timed tests), the main concern would be taking up too much RAM if the recording is really long