Skip to content

import NEST_SYNAPSE_TYPES from nest.__init__.py#306

Closed
mschmidt87 wants to merge 1 commit into
NeuralEnsemble:masterfrom
mschmidt87:commit_nest_synapse_types
Closed

import NEST_SYNAPSE_TYPES from nest.__init__.py#306
mschmidt87 wants to merge 1 commit into
NeuralEnsemble:masterfrom
mschmidt87:commit_nest_synapse_types

Conversation

@mschmidt87

Copy link
Copy Markdown
Contributor

The variable NEST_SYNAPSE_TYPES is defined once and then used by pyNN.nest.standardmodels.synapses._get_nest_synapse_model to check for available synapse types in NEST. Before, the function called nest.Models(mtype='synapses') at every function call, which slowed down things a lot, especially in the case of many single projections.

@apdavison

Copy link
Copy Markdown
Member

According to Yury, in #228, NEST_SYNAPSE_TYPES needs to be re-initialised after nest.ResetKernel(), so defining it only once will not work. Perhaps move the variable into the State class?

@mschmidt87

Copy link
Copy Markdown
Contributor Author

Hi, yes that's of course an important concern.
Thus, we have to re-initialize NEST_SYNAPSE_TYPES after each nest.ResetKernel.
With "moving into the State class", do you mean setting NEST_SYNAPSE_TYPES in State.clear(), where nest.ResetKernel() is called?

However, I think we cannot circumvent the problem if the user explicitely calls nest.ResetKernel() via pyNEST.

Another point is that the list has to be updated after each new synapse model definition. Is this only done in nest/synapses.py and nest/standardmodels/synapses.py, i.e. at every creation of a connection?

@jougs jougs changed the title impoer NEST_SYNAPSE_TYPES from nest.__init__.py import NEST_SYNAPSE_TYPES from nest.__init__.py May 15, 2014
@apdavison apdavison added the NEST label Dec 8, 2014
@apdavison

Copy link
Copy Markdown
Member

Closing this as no longer applicable. My apologies for not pursuing this further when it was first proposed.

The PR has been overtaken by later changes: it targets the old src/nest/ layout (now pyNN/nest/), and the nest.Models() call it optimises was removed in a305af7 ("fixes for NEST 3.3"), replaced by nest.synapse_models.

I looked into whether it was worth updating this for the current code. nest.synapse_models is not internally cached. It calls llapi_get_kernel_status() on every access so caching would still speed up the lookup considerably. However, _get_nest_synapse_model() reads it only once per synapse-model setup (not per connection), so the total overhead is very small.

@apdavison apdavison closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants