Reference guide: NEST 2.x vs NEST 3.0¶
This guide shows changes to functions or their output between PyNEST 2.x and PyNEST 3.0
For additional changes in NEST 3.1 and beyond see our What’s new
Functions not mentioned are unchanged
Terms that changed for NEST 3.0 are marked in green
Please note that NEST 3.0 no longer supports Python 2
See also
To see more of the key changes in 3.0, check out our list here.
Suppress output on startup¶
NEST 2.x |
NEST 3.0 |
---|---|
export DELAY_PYNEST_INIT = 1 import nest nest.ll_api.init([“nest”, “–quiet”]) |
export PYNEST_QUIET = 1 import nest |
Consistent use of allow_offgrid_times¶
NEST 2.x |
NEST 3.0 |
---|---|
nest.Create(“spike_generator”, params={“allow_offgrid_spikes”=True}) |
nest.Create(“spike_generator”, params={”allow_offgrid_times” =True}) |
Model names¶
The synapse model stdp_nn_pre-centered_synapse has been renamed to stdp_nn_pre_centered_synapse for consistency with the naming convention.
Parameters¶
Parameters can now be used to set node and connection parameters.
Note
Check out the section on Parametrization for example usage
random¶
The random module contains random distributions that can be used to set node and connection parameters, as well as positions for spatially distributed nodes.
NEST 2.x |
NEST 3.0 |
---|---|
nest.random.exponential(beta=1.0) returns nest.Parameter |
|
nest.random.lognormal(mean=0.0, std=1.0) returns nest.Parameter |
|
nest.random.normal(mean=0.0, std=1.0) returns nest.Parameter |
|
nest.random.uniform(min=0.0, max=1.0) returns nest.Parameter |
spatial¶
The spatial module contains parameters related to spatial positions for the nodes.
NEST 2.x |
NEST 3.0 |
---|---|
nest.spatial.distance.x nest.spatial.distance.y nest.spatial.distance.z returns nest.Parameter |
|
nest.spatial.distance returns nest.Parameter |
|
nest.spatial.free(pos, extent=None, edge_wrap=False, num_dimensions=None) returns nest.Parameter |
|
nest.spatial.grid(shape, center=None, extent=None, edge_wrap=False) returns nest.Parameter |
|
nest.spatial.pos.x nest.spatial.pos.y nest.spatial.pos.z returns nest.Parameter |
|
nest.spatial.source_pos.x nest.spatial.source_pos.y nest.spatial.source_pos.z returns nest.Parameter |
|
nest.spatial.target_pos.x nest.spatial.target_pos.y nest.spatial.target_pos.z returns nest.Parameter |
math¶
The math module contains parameters for mathematical expressions. The mathematical expressions all take a nest.Parameter.
NEST 2.X |
NEST 3.0 |
---|---|
nest.math.exp(nest.Parameter) returns nest.Parameter |
|
nest.math.sin(nest.Parameter) returns nest.Parameter |
|
nest.math.cos(nest.Parameter) returns nest.Parameter |
|
nest.math.min(nest.Parameter, value) returns nest.Parameter |
|
nest.math.max(nest.Parameter, value) returns nest.Parameter |
|
nest.math.redraw(nest.Parameter, min, max) returns nest.Parameter |
logic¶
The logic module contains logical expressions between nest.Parameter’s.
NEST 2.x |
NEST 3.0 |
---|---|
nest.logic.conditional(condition, param_if_true, param_if_false) returns nest.Parameter |
spatial_distributions¶
The spatial_distributions module contains random distributions that take a spatial parameter as input and applies the distribution on the parameter. They are used for spatially distributed nodes.
NEST 2.x |
NEST 3.0 |
---|---|
nest.spatial_distributions.exponential(nest.Parameter, beta=1.0) returns nest.Parameter |
|
nest.spatial_distributions.gaussian(nest.Parameter, mean=0.0, std=1.0) returns nest.Parameter |
|
nest.spatial_distributions.gaussian2D(nest.Parameter, nest.Parameter, mean_x=0.0, mean_y=0.0, std_x=1.0, std_y=1.0, rho=0.0) returns nest.Parameter |
|
nest.spatial_distributions.gamma(nest.Parameter, kappa=1.0 theta=1.0) returns nest.Parameter |
What’s removed from NEST 3.0?¶
Subnets¶
Subnets are gone. Instead NodeCollections should be used to group and organize neurons.
NEST 2.x
NEST 3.0
net = nest.LayoutNetwork(model, dim) nrns = nest.GetLeaves(net)[0] nrns = nest.Create(model, dim)
Printing the network as a tree of subnets is no longer possible. The
PrintNetwork()
function has been replaced with PrintNodes()
, which
prints ID ranges and model names of the nodes in the network.
NEST 2.x
NEST 3.0
>>> nest.PrintNetwork(depth=2, subnet=None) [0] root dim=[15] [1]...[10] iaf_psc_alpha [11]...[15] iaf_psc_exp >>> nest.PrintNodes() 1 .. 10 iaf_psc_alpha 11 .. 15 iaf_psc_exp
Models¶
With NEST 3.0, some models have been removed. They all have alternative models that can be used instead.
Removed model
Replacement model
iaf_neuron
iaf_psc_alpha
aeif_cond_alpha_RK5
aeif_cond_alpha
iaf_psc_alpha_presc
iaf_psc_alpha_ps
iaf_psc_delta_canon
iaf_psc_delta_ps
subnet
no longer needed, use NodeCollection instead
spike_detector
spike_recorder
Furthermore, the model iaf_tum_2000 has been renamed to iaf_psc_exp_htum. iaf_psc_exp_htum is the exact same model as iaf_tum_2000, it has just been renamed to match NEST’s naming conventions.
Functions¶
Some functions have also been removed. The removed functions where either related to subnets, or they can be replaced by using other functions with indexing into a NodeCollection.
The following functions have been removed:
|
|
|
|
|
|
|
|
|
(have never existed on PyNEST level, it was only a SLI function) |