Skip to content

Conversation

aaberbach
Copy link
Contributor

I was creating a cell model and came across an error in the following code:

for sec in self.hobj.soma:
n3d = int(h.n3d()) # get number of n3d points in each section
r3d = np.zeros((3, n3d)) # to hold locations of 3D morphology for the current section
n3dsoma += n3d
for i in range(n3d):
r3dsoma[0] += h.x3d(i, sec=sec)

where the h.x3d(i, sec=sec) goes out of bounds. This was caused by the h.n3d() not accessing the correct section. When no sec is provided, NEURON uses a default section, and in this case, it was incorrect. Therefore, I went through bmtk and filled in sec=sec for these situations. This may not be necessary in all cases, but I think this is a situation where it is better to be safe than sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant