Skip to content

Unexpected merging behavior in utils.connect() #647

Answered by michaeldeistler
VENOM314 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! Thanks for starting this discussion!

TL;DR: you can fix it as follows:

import pandas as pd

filtered_nodes = pd.concat(
    [net.cell(len(synapse_locations)).branch(b).loc(l).nodes for b, l in zip(branches, locs)]
)
post = net.select(nodes=filtered_nodes.index)

Longer explanation

The reason that this is failing is that you are trying to match pairs of branches and locs at the same time. This is, by default, not supported. To see what is going wrong, consider the following:

ncomp = 2
comp = jx.Compartment()
branch = jx.Branch(comp, ncomp)
cell = jx.Cell(branch, [-1, 0, 0, 1, 1])

branches = [0, 1]
locs = [0.1, 0.9]
cell.branch(branches).loc(locs).nodes  # Display the nodes in a jupyte…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by VENOM314
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants