Skip to content

Commit

Permalink
Fix flake8 complains
Browse files Browse the repository at this point in the history
  • Loading branch information
jorblancoa committed Feb 29, 2024
1 parent b78f5a2 commit 62fd6e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
11 changes: 4 additions & 7 deletions neurodamus/core/stimuli.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def shot_noise(cls, tau_D, tau_R, rate, amp_mean, var, duration, dt=0.25, base_a

@classmethod
def ornstein_uhlenbeck(cls, tau, sigma, mean, duration, dt=0.25, base_amp=.0, **kw):
return cls(base_amp, **kw).add_ornstein_uhlenbeck(tau, sigma, mean,duration, dt)
return cls(base_amp, **kw).add_ornstein_uhlenbeck(tau, sigma, mean, duration, dt)

# Operations
def __add__(self, other):
Expand Down Expand Up @@ -434,21 +434,18 @@ class _DynamicClamp:
def __init__(self, cell_section, position=0.5, clamp_container=None,
stim_vec_mode=True, time_vec=None, stim_vec=None,
reversal=0.0, **clamp_params):


# Check sif new conductanceSource mechanism is available

# Checks if new conductanceSource mechanism is available
mt = Neuron.h.MechanismType(1)
mname = Neuron.h.ref('')
mList = []
for i in range(mt.count()):
mt.select(i)
mt.selected(mname)
mList.append(mname[0])

if 'conductanceSource' in mList:

if 'conductanceSource' in mList:
self.clamp = Neuron.h.conductanceSource(position, sec=cell_section)

else:
self.clamp = Neuron.h.SEClamp(position, sec=cell_section)

Expand Down
9 changes: 4 additions & 5 deletions neurodamus/stimulus_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,6 @@ def __init__(self, target, stim_info: dict, cell_manager):
if not sc.exists():
continue

# create single electrode voltage clamp at location

# Checks if new conductanceSource mechanism is available
mt = Nd.h.MechanismType(1)
mname = Nd.h.ref('')
Expand All @@ -743,13 +741,14 @@ def __init__(self, target, stim_info: dict, cell_manager):
mt.select(i)
mt.selected(mname)
mList.append(mname[0])

# If conductanceSource not available, insert standard SEClamp
if 'conductanceSource' in mList:
if 'conductanceSource' in mList:
seclamp = Nd.h.conductanceSource(tpoint_list.x[sec_id], sec=sc.sec)
else:
# create single electrode voltage clamp at location
seclamp = Nd.h.SEClamp(tpoint_list.x[sec_id], sec=sc.sec)

seclamp.rs = self.rs
seclamp.dur1 = self.duration
seclamp.amp1 = self.vhold
Expand Down

0 comments on commit 62fd6e2

Please sign in to comment.