diff --git a/neurodamus/core/stimuli.py b/neurodamus/core/stimuli.py index 0dbf2e66..46e81678 100644 --- a/neurodamus/core/stimuli.py +++ b/neurodamus/core/stimuli.py @@ -434,17 +434,9 @@ 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): - - # 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: + + # Checks if new conductanceSource mechanism is available + if hasattr(Neuron.h, "conductanceSource"): 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 b508fd01..8b147b7e 100644 --- a/neurodamus/stimulus_manager.py +++ b/neurodamus/stimulus_manager.py @@ -733,17 +733,8 @@ def __init__(self, target, stim_info: dict, cell_manager): if not sc.exists(): continue - # Checks if new conductanceSource mechanism is available - mt = Nd.h.MechanismType(1) - mname = Nd.h.ref('') - mList = [] - for i in range(mt.count()): - mt.select(i) - mt.selected(mname) - mList.append(mname[0]) - # If conductanceSource not available, insert standard SEClamp - if 'conductanceSource' in mList: + if hasattr(Nd.h, "conductanceSource"): seclamp = Nd.h.conductanceSource(tpoint_list.x[sec_id], sec=sc.sec) else: # create single electrode voltage clamp at location