Skip to content

Commit

Permalink
MAINT: remove another method
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed May 1, 2021
1 parent 9b1921b commit a151d0f
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions hnn_core/cell_classes.py
Expand Up @@ -165,6 +165,9 @@ def __init__(self, pos, celltype, override_params=None, gid=None):
'km': ['gbar_km'],
'cat': ['gbar_cat']
}
section_names = ['apical_trunk', 'apical_1',
'apical_2', 'apical_tuft',
'apical_oblique', 'basal_1', 'basal_2', 'basal_3']
elif celltype == 'L2_pyramidal':
p_all_default = get_L2Pyr_params_default()
self.name = 'L2Pyr'
Expand All @@ -173,6 +176,8 @@ def __init__(self, pos, celltype, override_params=None, gid=None):
'km': ['gbar_km'],
'hh2': ['gkbar_hh2', 'gnabar_hh2',
'gl_hh2', 'el_hh2']}
section_names = ['apical_trunk', 'apical_1', 'apical_tuft',
'apical_oblique', 'basal_1', 'basal_2', 'basal_3']
else:
raise ValueError(f'Unknown pyramidal cell type: {celltype}')

Expand All @@ -181,20 +186,19 @@ def __init__(self, pos, celltype, override_params=None, gid=None):
assert isinstance(override_params, dict)
p_all = compare_dictionaries(p_all_default, override_params)

# Get somatic, dendritic, and synapse properties
soma_props = _get_soma_props(p_all, self.name)

Cell.__init__(self, pos=pos, gid=gid)

level2_keys = ['L', 'diam', 'Ra', 'cm']
# Get somatic, dendritic, and synapse properties
p_soma = _get_soma_props(p_all, self.name)
p_dend = _flat_to_nested(p_all, cell_type=self.name,
level1_keys=self.section_names(),
level1_keys=section_names,
level2_keys=level2_keys)
p_syn = _get_syn_props(p_all, self.name)

# Geometry
# dend Cm and dend Ra set using soma Cm and soma Ra
self.create_soma(soma_props)
self.create_soma(p_soma)
self.create_dends(p_dend) # just creates the sections
self.sections = [self.soma] + list(self.dends.values())

Expand Down Expand Up @@ -238,7 +242,7 @@ def __init__(self, pos, celltype, override_params=None, gid=None):
self.insert_dipole(yscale)

# create synapses
self._synapse_create(p_syn)
self._synapse_create(p_syn, section_names)

def set_geometry(self, p_dend):
"""Define shape of the neuron and connect sections.
Expand All @@ -265,15 +269,7 @@ def set_geometry(self, p_dend):
if not self.dends[key].nseg % 2:
self.dends[key].nseg += 1

def section_names(self):
if self.name == 'L2Pyr':
return ['apical_trunk', 'apical_1', 'apical_tuft',
'apical_oblique', 'basal_1', 'basal_2', 'basal_3']
else:
return ['apical_trunk', 'apical_1', 'apical_2', 'apical_tuft',
'apical_oblique', 'basal_1', 'basal_2', 'basal_3']

def _synapse_create(self, p_syn):
def _synapse_create(self, p_syn, section_names):
"""Creates synapses onto this cell."""
# Somatic synapses
self.synapses['soma_gabaa'] = self.syn_create(self.soma(0.5),
Expand All @@ -282,7 +278,7 @@ def _synapse_create(self, p_syn):
**p_syn['gabab'])

# Dendritic synapses
for sec in self.section_names():
for sec in section_names:
for receptor in p_syn:
syn_key = sec.replace('_', '') + '_' + receptor
self.synapses[syn_key] = self.syn_create(
Expand Down

0 comments on commit a151d0f

Please sign in to comment.