Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

fix: Fix targetting class to be neuron compatible#898

Merged
Helveg merged 17 commits intodevfrom
fix/targetting_neuron_compatible
Apr 12, 2025
Merged

fix: Fix targetting class to be neuron compatible#898
Helveg merged 17 commits intodevfrom
fix/targetting_neuron_compatible

Conversation

@danilobenozzo
Copy link
Contributor

@danilobenozzo danilobenozzo commented Oct 31, 2024

Describe the work done

  • Add an option to get all global IDs with CellTypeFilter when get_targets() method is called.
  • Add spherical targetting per cell types.
  • ByIdTargetting fixed to use global IDs

@github-actions github-actions bot added the fix label Oct 31, 2024
Copy link
Contributor

@Helveg Helveg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition, just some optimization problems. You create intermediary lists and use N^2 lookup where you probably don't need it

filimarc and others added 2 commits December 16, 2024 11:33
shortcut

Co-authored-by: Robin De Schepper <robin.deschepper93@gmail.com>
Copy link
Contributor

@Helveg Helveg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ByIdTargetting is inefficient:

  • It uses if ids in ps_ids N times, with inside of it ps_ids.index ~> O(2 * n^2). This will explode and never finish if someone copies a list of 1000 cell ids into a 100k cell simulation.
  • It's conceptually going roundabout: it relies on ps.load_ids which takes the chunk local ids and combines it with the chunk stats and expands them into global ids, to then look up the position of a global id in the expanded global ids, to then arrive back at the local id.

The fundamental task here is to take an array of global ids and to express it in local ids of a given PS. This is a missing piece of logic it seems (@drodarie could you look through the PS/CS and ConnectivitySetIterator interface classes and bsb-hdf5.. I feel like I wrote this already).

If you want to implement this efficiently, you would have to write a new piece of logic in bsb-hdf5 and/or NeuronPopulation that uses the PlacementSets chunks, and the chunk_stats and uses simple arithmetics to calculate the local id of each global id. @drodarie could you help Danilo piece this together?

@filimarc
Copy link
Contributor

filimarc commented Feb 18, 2025

With this commit i will use a method, that i've added to bsb-hdf5, to convert global ids into local ids.
It is linked to: dbbs-lab/bsb-hdf5#40

@Helveg Helveg changed the base branch from main to dev April 12, 2025 15:58
@Helveg Helveg merged commit e8d8970 into dev Apr 12, 2025
7 of 10 checks passed
@Helveg Helveg deleted the fix/targetting_neuron_compatible branch April 12, 2025 16:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants