From 62fd6e2b549eda08353b2b46b1c12652e5e72fd8 Mon Sep 17 00:00:00 2001 From: Jorge Blanco Alonso Date: Wed, 28 Feb 2024 11:18:53 +0100 Subject: [PATCH] Fix flake8 complains --- neurodamus/core/stimuli.py | 11 ++++------- neurodamus/stimulus_manager.py | 9 ++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/neurodamus/core/stimuli.py b/neurodamus/core/stimuli.py index f9293d95..0dbf2e66 100644 --- a/neurodamus/core/stimuli.py +++ b/neurodamus/core/stimuli.py @@ -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): @@ -434,9 +434,8 @@ 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 = [] @@ -444,11 +443,9 @@ def __init__(self, cell_section, position=0.5, clamp_container=None, 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) diff --git a/neurodamus/stimulus_manager.py b/neurodamus/stimulus_manager.py index 4ff8a42d..b508fd01 100644 --- a/neurodamus/stimulus_manager.py +++ b/neurodamus/stimulus_manager.py @@ -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('') @@ -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