Support retrieving the current value of state variables without recording
I propose to extend the get() method of Population, PopulationView and Assembly to allow returning the current value of state variables, such as the membrane potential.
Hello, Does the current version has this feature?
No, this has not yet been implemented.
Any idea about when this feature will be released? May be I could try looking into this if this is not a juggernaut task.
There is no particular timeline for implementing this. I would be happy for you to look into it.
A few suggestions for the implementation:
- in the definition for
common.Population.get(), you will see that the parameters are retrieved through a private method_get_parameter_dict(), which then calls_get_parameters(). The latter method is implemented separately for each simulator, i.e. asneuron.Population._get_parameters(),nest.Population._get_parameters(), etc. - to retrieve state variables through
Population.get(), I suggest first creating a method_get_state_variables()for each simulatorPopulationclass. - implementing
_get_state_variables()should be quite simple- for NEURON, something like
[cell._cell.v for cell in population.all_cells]will give you the values ofvfor a whole population - for NEST, the equivalent is
nest.GetStatus(p.all_cells.tolist(), 'V_m') - for Brian, I don't remember off the top of my head how to access the state variables, but I think it's quite simple
- for NEURON, something like
- you will have to take care of translating variable names (e.g. 'v' --> 'V_m' for NEST) and units (e.g. pA --> nA for currents in NEST). The information needed for this is mostly in the celltype definitions in
standardmodels.cellsor innest.recording, etc.
I wrote a few lines of code as you suggested, I tested it with Neuron and I could read the membrane potentials. I haven't tried it with Brian or Nest. Thank you for your valuable insights.