for debugging processes, I would like to test if an object passed as argument to a class is indeed a Segment. I though that checking it with isinstance() would be appropriate, but unfortunately this launches an error:
here a minimal example:
Code: Select all
from neuron import h
soma = h.Section(name = 'soma')
soma.nseg = 3
# a list of segments
soma_seg = [seg for seg in soma]
Code: Select all
stim = IClamp(soma_seg[1])
but
Code: Select all
isinstance(soma_seg[1], h.Segment)
AttributeError: 'hoc.HocObject' object has no attribute 'Segment'
Am I doing something wrong?
Thanks a lot in advance