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

Allow renamed channels in simulation #225

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Allow renamed channels in simulation #225

merged 2 commits into from
Jan 19, 2024

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Jan 19, 2024

Previously, we used type(channel).__name__ to determine if a channel already exists in the network.

However, if we rename a channel, we want to consider the channel a new (different) channel with its own parameter names etc. Therefore, we now use channel._name to determine if a channel already exists.

The difference is easily visible when doing:

renamed_hh = HH()
renamed_hh.change_name("NeuronHH")

comp = jx.Compartment()
branch = jx.Branch(comp, nseg=4)

branch.comp(0.0).insert(HH())
branch.insert(renamed_hh)

And then inspecting branch.nodes["HH"]. Before this commit, this returned:

0    True
1    True
2    True
3    True
Name: HH, dtype: bool

Now, it returns:

0    False
1    False
2    False
3     True
Name: HH, dtype: bool

@huangziwei FYI

@michaeldeistler michaeldeistler merged commit 4b16f50 into main Jan 19, 2024
1 check passed
@michaeldeistler michaeldeistler deleted the channels branch January 19, 2024 08:20
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