Skip to content

Commit

Permalink
Improve get_all_sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed Sep 1, 2020
1 parent 15bbb66 commit fd22ee6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hnn_core/lfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@


# get all Sections
def getallSections(ty='Pyr'):
def get_all_sections(sec_type='Pyr'):
ls = h.allsec()
ls = [s for s in ls if s.name().count(ty) > 0 or len(ty) == 0]
ls = [s for s in ls if sec_type in s.name()]
return ls


Expand Down Expand Up @@ -111,7 +111,7 @@ def transfer_resistance(self, exyz, method):
from numpy.linalg import norm

vres = h.Vector()
lsec = getallSections()
lsec = get_all_sections()
sigma = self.sigma

exyz = np.array(exyz) # electrode position
Expand All @@ -130,7 +130,7 @@ def transfer_resistance(self, exyz, method):
# setting radius limit
if dis < s.diam / 2.0:
dis = s.diam / 2.0 + 0.1

phi = 1. / dis

elif method == 'lsa':
Expand Down Expand Up @@ -173,7 +173,7 @@ def transfer_resistance(self, exyz, method):
return vres

def LFPinit(self):
lsec = getallSections()
lsec = get_all_sections()
n_sections = len(lsec)

self.imem_ptrvec = h.PtrVector(n_sections)
Expand Down Expand Up @@ -227,7 +227,7 @@ def callback(self):
h.tstop = 2000.0

elec = LFPElectrode([0, 100.0, 100.0], pc=h.ParallelContext(),
method='psa')
method='lsa')
elec.setup()
elec.LFPinit()
h.run()
Expand Down

0 comments on commit fd22ee6

Please sign in to comment.