Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring NEURON 3d() functions target the correct section. #149

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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.

None yet

1 participant