Skip to content

Commit

Permalink
Added branch location targetting (#767)
Browse files Browse the repository at this point in the history
* Updated neuron devices to bsb v4
- current clamp, spike generator,  voltage recorder, voltage clamp
- Added LabelTargetting
- Added __lt__ method in TransceiverModel

* Added tags attribute in MorphologyDependencyNode

* Bug fixes.
- Added __lt__ method in TransceiverModel
- NeuronCell instances saves id and positions
- Renamed instance.model to instance.cell_model

* Synapse names are retrived from MechAccessor var

* Added neuron unittests

* Fixed create_transmitters and _allocate_transmitters
- create_transmitters: Now the id of the cells in simdata are mapped through simdata.transmap and the adapter works with multithreads.
-  _allocate_transmitters: fixed gid
- Fixed a report message

* black fix

* test GHA run with dbbs-models

* fix engine references

* fix property assignment

* raise error for using arborize models with missing morphos

* pass on synapse spec weight and delay to `insert_receiver`

* fix

* updated device

* neuron device updates

* removed test configs

---------

Co-authored-by: alessiomarta <81438612+alessiomarta@users.noreply.github.com>
Co-authored-by: alessio <alessio.marta@gmail.com>
Co-authored-by: Robin De Schepper <robin.deschepper93@gmail.com>
  • Loading branch information
4 people committed Nov 9, 2023
1 parent 7f12b38 commit b69a218
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bsb/simulation/targetting.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,22 @@ def get_locations(self, cell):
if all(l in loc.section.labels for l in self.labels)
]
return locs


@config.node
class BranchLocTargetting(LabelTargetting, classmap_entry="branch"):
x = config.attr(type=types.fraction(), default=0.5)

def get_locations(self, cell):
locations = super().get_locations(cell)
branches = set()
selected = []
for loc in locations:
if (
loc._loc[0] not in branches
and loc.arc(0) <= self.x
and loc.arc(1) > self.x
):
selected.append(loc)
branches.add(loc._loc[0])
return selected

0 comments on commit b69a218

Please sign in to comment.