Skip to content

Population parameters#1653

Open
Christian-B wants to merge 9 commits into
masterfrom
pop_params
Open

Population parameters#1653
Christian-B wants to merge 9 commits into
masterfrom
pop_params

Conversation

@Christian-B
Copy link
Copy Markdown
Member

@Christian-B Christian-B commented Feb 20, 2026

Specifically adds a few create model parameters that can be added to Populations.

The ones I found

  • max_rate
  • n_colour_bits
  • n_synapse_cores
  • neurons_per_core
  • port
  • reserve_reverse_ip_tag
  • seed
  • splitter
  • virtual_key:

Other ones would continue to work as additional_parameters or kwargs


Docs for params based on what was found in the model or vertex.


Ugliness:

mypy got confused on extended classes which required converting kwargs to additional_parameters

@Christian-B Christian-B requested a review from rowleya February 20, 2026 15:33
@rowleya
Copy link
Copy Markdown
Member

rowleya commented Apr 15, 2026

I note that some (possibly many) of these additional parameters are not general to all populations, that is, they depend on the model being run. We allow the passing of these parameters at the Population level because they will apply to the vertex that the model gets converted to, rather than to each atom of the Population, which the model itself represents. This is a tricky distinction! I wonder if it would be better to document these somehow in the model, but as I say, these are tricky things to represent...

:param virtual_key:
Model.create_vertex parameter.
Likely:
The virtual_key of the population to identify the population.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this unfortunately adds to the confusion; adding these parameters implies all models accept them but in reality they don't. I would prefer that this is left to the model itself to document therefore.

A note here is that PyNN itself doesn't actually accept additional parameters, so what we do with this is our own; we could, in fact, force that all parameters are something that the vertex accepts.

Additional note is that these are not the same as the cell_params (which are, in fact, deprecated). The cell_params are arguments passed when creating the model, the additional_args are arguments passed when creating the vertex, and model is also one of those arguments. In our case, we accept a vertex in place of a model, so this could be resolved that way instead, but it would then start also to look odd when working with standard models, as you would then have something like p.Population(n_neurons, p.PopulationVertex(..., model=p.IF_curr_exp(...))).

Comment on lines +146 to +149
See the Model's create_vertex method for more details.
create_vertex parameters will be ignored if
the Model does not accept this parameter,
or raise an Exception if a Vertex is passed in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I actually think that we should raise an exception in both cases, especially if this is the only use of these additional args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants