Info module

Functions to provide additional information.

Functions to get information on NEST.

nest.lib.hl_api_info.GetStatus(nodes, keys=None, output='')

Return the parameter dictionaries of nodes or connections.

If keys is given, a list of values is returned instead. keys may also be a list, in which case the returned list contains lists of values.

Parameters:
  • nodes (NodeCollection or SynapseCollection) – Either a NodeCollection representing nodes, or a SynapseCollection of connection handles as returned by GetConnections().

  • keys (str or list, optional) – string or a list of strings naming model properties. GetStatus 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 selected format (output='json').

Returns:

  • list of dicts – All parameters in a dict for each node or connection.

  • list of values – If keys is a string, the value of the corresponding parameter for each node or connection is returned.

  • list of lists of values – If keys is a list of strings, a list of values of the corresponding parameters for each node or connection is returned.

  • str – If output is json, the above formats are converted to JSON format before they are returned.

Raises:

TypeError – If nodes or keys are on the wrong form.

Examples

For nodes:

>>>    nest.GetStatus(nodes)
       ({'archiver_length': 0,
         'beta_Ca': 0.001,
         ...
         'global_id': 1,
         ...
         'vp': 0},
        ...
        {'archiver_length': 0,
         'beta_Ca': 0.001,
         ...
         'global_id': 3,
         ...
         'vp': 0})
>>>    nest.GetStatus(nodes, 'V_m')
       (-70.0, -70.0, -70.0)
>>>    nest.GetStatus(nodes, ['V_m', 'C_m'])
       ((-70.0, 250.0), (-70.0, 250.0), (-70.0, 250.0))
>>>    nest.GetStatus(nodes, ['V_m', 'C_m'], output='json')
       '[[-70.0, 250.0], [-70.0, 250.0], [-70.0, 250.0]]'

For connections:

>>>    nest.GetStatus(conns)
       ({'delay': 1.0,
         ...
         'source': 1,
         ...
         'weight': 1.0},
        ...
        {'delay': 1.0,
         ...
         'source': 3,
         ...
         'weight': 1.0})
>>>    nest.GetStatus(conns, 'weight')
       (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
>>>    nest.GetStatus(conns, ['source', 'delay'])
       ((1, 1.0),
        ...
        (3, 1.0))
>>>    nest.GetStatus(conns, ['source', 'delay'], output='json')
       '[[1, 1.0], [1, 1.0], [1, 1.0], [2, 1.0], [2, 1.0], [2, 1.0],
       [3, 1.0], [3, 1.0], [3, 1.0]]'
nest.lib.hl_api_info.SetStatus(nodes, params, val=None)

Set parameters of nodes or connections.

Parameters of nodes or connections, given in nodes, is set as specified by params. If val is given, params has to be a string with the name of an attribute, which is set to val on the nodes/connections. val can be a single value or a list of the same size as nodes.

Parameters:
  • nodes (NodeCollection or SynapseCollection) – Either a NodeCollection representing nodes, or a SynapseCollection of connection handles as returned by GetConnections().

  • params (str or dict or list) – Dictionary of parameters (either lists or single values) or list of dictionaries of parameters of same length as nodes. If val is given, this has to be a string giving the name of a model property.

  • val (int, list, optional) – If given, params has to be the name of a model property.

Raises:

TypeError – If nodes is not a NodeCollection of nodes, a SynapseCollection of synapses, or if the number of parameters don’t match the number of nodes or synapses.

nest.lib.hl_api_info.authors()

Print the authors of NEST.

nest.lib.hl_api_info.get_argv()

Return argv as seen by NEST.

This is similar to Python sys.argv but might have changed after MPI initialization.

Returns:

Argv, as seen by NEST

Return type:

tuple

nest.lib.hl_api_info.get_verbosity()

Return verbosity level of NEST’s messages.

  • M_ALL=0, display all messages

  • M_INFO=10, display information messages and above

  • M_DEPRECATED=18, display deprecation warnings and above

  • M_WARNING=20, display warning messages and above

  • M_ERROR=30, display error messages and above

  • M_FATAL=40, display failure messages and above

Returns:

The current verbosity level

Return type:

int

nest.lib.hl_api_info.help(obj=None, return_text=False)

Display the help page for the given object in a pager.

If return_text is omitted or explicitly given as False, this command opens the help text for object in the default pager using the pydoc module.

If return_text is True, the help text is returned as a string in reStructuredText format instead of displaying it.

Parameters:
  • obj (object, optional) – Object to display help for

  • return_text (bool, optional) – Option for returning the help text

Returns:

The help text of the object if return_text is True.

Return type:

None or str

nest.lib.hl_api_info.helpdesk()

Open the NEST documentation index in a browser.

This command opens the NEST documentation index page using the system’s default browser.

Please note that the help pages will only be available if you ran make html prior to installing NEST. For more details, see Documentation workflows.

nest.lib.hl_api_info.message(level, sender, text)

Print a message using message system of NEST.

Parameters:
  • level – Level

  • sender – Message sender

  • text (str) – Text to be sent in the message

nest.lib.hl_api_info.set_verbosity(level)

Change verbosity level for NEST’s messages.

  • M_ALL=0, display all messages

  • M_INFO=10, display information messages and above

  • M_DEPRECATED=18, display deprecation warnings and above

  • M_WARNING=20, display warning messages and above

  • M_ERROR=30, display error messages and above

  • M_FATAL=40, display failure messages and above

Note

To suppress the usual output when NEST starts up (e.g., the welcome message and version information), you can run export PYNEST_QUIET=1 on the command line before executing your simulation script.

Parameters:

level (str, default: 'M_INFO') – Can be one of ‘M_FATAL’, ‘M_ERROR’, ‘M_WARNING’, ‘M_DEPRECATED’, ‘M_INFO’ or ‘M_ALL’.

nest.lib.hl_api_info.sysinfo()

Print information on the platform on which NEST was compiled.