Models module

Functions for model handling

nest.lib.hl_api_models.CopyModel(existing, new, params=None)

Create a new model by copying an existing one.

Parameters:
  • existing (str) – Name of existing model

  • new (str) – Name of the copied model

  • params (dict, optional) – Default parameters assigned to the copy. Not provided parameters are taken from the existing model.

nest.lib.hl_api_models.GetDefaults(model, keys=None, output='')

Return defaults of the given model or recording backend.

Parameters:
  • model (str) – Name of the model or recording backend

  • keys (str or list, optional) – String or a list of strings naming model properties. GetDefaults then returns a single value or a list of values belonging to the keys given.

  • output (str, optional) – Whether the returned data should be in a format (output='json'). Default is ‘’.

Returns:

  • dict – A dictionary of default parameters.

  • type – If keys is a string, the corrsponding default parameter is returned.

  • list – If keys is a list of strings, a list of corrsponding default parameters is returned.

  • str – If output is json, returns parameters in JSON format.

Raises:

TypeError

nest.lib.hl_api_models.SetDefaults(model, params, val=None)

Set defaults for the given model or recording backend.

New default values are used for all subsequently created instances of the model.

Parameters:
  • model (str) – Name of the model or recording backend

  • params (str or dict) – Dictionary of new default parameter values

  • val (str, optional) – If given, params has to be the name of a parameter.

Deprecated function

ConnectionRules deprecated since 3.3.

Use connection_rules instead.

nest.lib.hl_api_models.ConnectionRules()

Return a tuple of all available connection rules, sorted by name.

Returns:

Available connection rules, sorted by name

Return type:

tuple

Deprecated function

Models deprecated since 3.3.

Use node_models or synapse_models instead.

nest.lib.hl_api_models.Models(mtype='all', sel=None)

Return a tuple of neuron, device, or synapse model names.

Parameters:
  • mtype (str, optional) – Use mtype='nodes' to only get neuron and device models, or mtype='synapses' to only get synapse models.

  • sel (str, optional) – Filter results and only return models containing sel.

Returns:

Available model names, sorted by name

Return type:

tuple

Raises:

ValueError – Description

Notes

  • Synapse model names ending in _hpc require less memory because of thread-local indices for target neuron IDs and fixed rports of 0.

  • Synapse model names ending in _lbl allow to assign an integer label (synapse_label) to each individual synapse, at the cost of increased memory requirements.