Skip to content

Commit

Permalink
fix rebase conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
katduecker committed Jun 28, 2024
2 parents d91fc94 + a1d230e commit 9e23ae6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
17 changes: 17 additions & 0 deletions hnn_core/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,15 @@ def record(self, record_vsec=False, record_isec=False, record_ca=False):
Option to record voltages from all sections ('all'), or just
the soma ('soma'). Default: False.
record_ca : 'all' | 'soma' | False
<<<<<<< HEAD
<<<<<<< HEAD
Option to record calcium concentration from all sections ('all'),
=======
Option to record calcium concentration from all sections ('all'),
>>>>>>> d3105f90 (record calcium concentration in L5pyr)
=======
Option to record calcium concentration from all sections ('all'),
>>>>>>> a1d230e27c4585f7612290bf90cf572c5102dfaf
or just the soma ('soma'). Default: False.
"""

Expand Down Expand Up @@ -825,6 +829,19 @@ def record(self, record_vsec=False, record_isec=False, record_ca=False):
self.ca[sec_name].record(
self._nrn_sections[sec_name](0.5)._ref_cai)

# calcium concentration
if record_ca == 'soma':
self.ca = dict.fromkeys(['soma'])
elif record_ca == 'all':
self.ca = dict.fromkeys(section_names)

if record_ca:
for sec_name in self.ca:
if hasattr(self._nrn_sections[sec_name](0.5), '_ref_cai'):
self.ca[sec_name] = h.Vector()
self.ca[sec_name].record(
self._nrn_sections[sec_name](0.5)._ref_cai)

def syn_create(self, secloc, e, tau1, tau2):
"""Create an h.Exp2Syn synapse.
Expand Down
4 changes: 4 additions & 0 deletions hnn_core/cell_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def ca(self):
def ca(self):
return self._ca

@property
def ca(self):
return self._ca

@property
def times(self):
return self._times
Expand Down
7 changes: 7 additions & 0 deletions hnn_core/network_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ def simulation_time():
if ca is not None:
ca_py[gid][sec_name] = ca.to_python()

ca_py = dict()
for gid, ca_dict in neuron_net._ca.items():
ca_py[gid] = dict()
for sec_name, ca in ca_dict.items():
if ca is not None:
ca_py[gid][sec_name] = ca.to_python()

dpl_data = np.c_[
neuron_net._nrn_dipoles['L2_pyramidal'].as_numpy() +
neuron_net._nrn_dipoles['L5_pyramidal'].as_numpy(),
Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _run_hnn_core_fixture(backend=None, n_procs=None, n_jobs=1,
reduced=False, record_vsec=False,
record_isec=False, record_ca=False,
postproc=False, electrode_array=None):

hnn_core_root = op.dirname(hnn_core.__file__)

# default params
Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/test_dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_cell_response_backends(run_hnn_core_fixture):
trial_idx][gid]['soma']['soma_gabaa']) == n_times

assert len(joblib_net.cell_response.ca[
trial_idx][gid]['soma']) == n_times
trial_idx][gid]['soma']['soma_gabaa']) == n_times
assert len(mpi_net.cell_response.vsec) == n_trials
assert len(mpi_net.cell_response.isec) == n_trials
assert len(mpi_net.cell_response.vsec[trial_idx][gid]) == 8 # num sec
Expand Down

0 comments on commit 9e23ae6

Please sign in to comment.