dbbs-lab / bsb-core

The Brain Scaffold Builder
https://bsb.readthedocs.io
GNU General Public License v3.0
21 stars 16 forks source link

Loadting positions from ConnectivitySet #849

Closed drodarie closed 2 months ago

drodarie commented 2 months ago

I am trying to load the positions of the presynaptic cells of a ConnectivitySet that are located in a list of chunks.

cs = self.scaffold.get_connectivity_set("connection_name")
pre_chunks = [...]  # list of Chunks
conn_ = cs.load_connections().from_(pre_chunks)
pre_locs, _ = conn_.as_scoped().all()
u_pre = np.unique(glom_locs[:, 0])

pre_positions = cs.pre_type.get_placement_set(chunks=pre_chunks).load_positions()

print(len(u_pre))  # in my case 1742
print(len(pre_positions))  # in my case 1740

Something is off with these numbers: my u_pre size should be greater or equal to pre_positions, right?
Is it the correct way to load the positions? Did I mess up with my connection_name connection?

drodarie commented 2 months ago

Nevermind my other connection seems to have caused the issue.