Conversation
|
In But maybe there is a better way to do that. I have also to think a sort of test for this device... |
|
Try with |
fix empty SpikeTrain allocation
|
@Helveg could you please review this PR, we would like to bump the main bsb package. |
Helveg
left a comment
There was a problem hiding this comment.
Couple of small issues, but I think this is good :)
bsb_neuron/devices/spike_recorder.py
Outdated
|
|
||
| def check_netcon(self, adapter, target, location): | ||
| # Insert a NetCon (if not already present) and retrieve its gid | ||
| if hasattr(location.section, "_transmitter"): |
There was a problem hiding this comment.
This is an implementation detail of arborize, this private attribute should not be accessed directly in the BSB, instead the proper util function of arborize should be used/added to retrieve this
There was a problem hiding this comment.
I moved the check_netcon method to arborize
bsb_neuron/devices/spike_recorder.py
Outdated
| adapter, simulation, simdata | ||
| ).items(): | ||
| if self.join_population: | ||
| spike_times = p.parallel._interpreter.Vector() |
There was a problem hiding this comment.
this doesn't look like the proper idiom for accessing the hoc interpreter either
There was a problem hiding this comment.
Since i haven't found a better way to access the interpreter Vector i have created a property in
ParallelContext for that. If you think this is a good approach i will create the PR on Arborize and Patch.
There was a problem hiding this comment.
Hmm, it's been too long since I designed the bsb-neuron code, so I don't remember, but we'd have to look through the source code to answer these questions:
- Does the
NeuronAdapterever use the hoc interpreter directly?- If so, how does it do it? We should stick to a single pattern and repeat it.
- If it hasn't ever used the interpreter directly, why would we have to now? Perhaps, by design, I have always avoided this, and used utility functions in the underlying packages? If so, we should probably also repeat that pattern now.
There was a problem hiding this comment.
I think that models are free to build themselves however they like, and that there isn't much interface you can rely on. I think most code so far has been written assuming every model will be built by the arborize package. We'd have to have a meeting to talk about this decision, and write out documentation. Without a decision it's hard to create a specification/interface that the adapter can rely on for targetting/devices, which require the interface to retrieve information about the model instances.
There was a problem hiding this comment.
Sorry i have already understood that i can call directly without any modification of patch:
spike_times = p.Vector()
To answer to your question in BSB-Neuron devices usually we do not use directly the Hoc Interpreter, but we call it in the record function in NeuronResult. The difference is that in this new case we have to create a Vector shared among different cells.
A new device for spike detection is proposed. It cycle over the cells in the population, assigning an gid to every location to record.
SpikeTrains for cells in the same population are joined togheter, i tried to emulate the SpikeTrains annotations of the nest case. The default locations is "soma".