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

  • 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 code examples of the key changes, check out our NEST 3.0 Features.

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