nest.ll_api module

Low-level API of PyNEST Module

class nest.ll_api.KernelAttribute(typehint, description, readonly=False, default=None, localonly=False)

Bases: object

Descriptor that dispatches attribute access to the nest kernel.

nest.ll_api.check_stack(thing)

Convenience wrapper for applying the stack_checker decorator to all class methods of the given class, or to a given function.

If the object cannot be decorated, it is returned unchanged.

Parameters:

thing (function or class) – Description

Returns:

Decorated function or class

Return type:

function or class

Raises:

ValueError

nest.ll_api.connect_arrays(sources, targets, weights, delays, synapse_model, syn_param_keys, syn_param_values)
nest.ll_api.get_debug()

Return the current value of the debug flag of the low-level API.

Returns:

current value of the debug flag

Return type:

bool

nest.ll_api.set_communicator(comm)

Set global communicator for NEST.

Parameters:

comm (MPI.Comm from mpi4py) –

Raises:

_kernel.NESTError

nest.ll_api.set_debug(dbg=True)

Set the debug flag of the low-level API.

Parameters:

dbg (bool, optional) – Value to set the debug flag to

nest.ll_api.sli_func(s, *args, **kwargs)

Convenience function for executing an SLI command s with arguments args.

This executes the SLI sequence: sli_push(args); sli_run(s); y=sli_pop()

Parameters:
  • s (str) – Function to call

  • *args – Arbitrary number of arguments to pass to the SLI function

  • **kwargs

    namespacestr

    The sli code is executed in the given SLI namespace.

    litconvbool

    Convert string args beginning with / to literals.

Returns:

  • The function may have multiple return values. The number of return values

  • is determined by the SLI function that was called.

Examples

r,q = sli_func(‘dup rollu add’,2,3) r = sli_func(‘add’,2,3) r = sli_func(‘add pop’,2,3)

nest.ll_api.sli_pop()
nest.ll_api.sli_push(obj)
nest.ll_api.sli_run(cmd)

Send a command string to the NEST kernel to be executed, catch SLI errors and re-raise them in Python.

Parameters:

cmd (str) – The SLI command to be executed.

Raises:

kernel.NESTError – SLI errors are bubbled to the Python API as NESTErrors.

nest.ll_api.spp()
nest.ll_api.sps(obj)
nest.ll_api.sr(cmd)

Send a command string to the NEST kernel to be executed, catch SLI errors and re-raise them in Python.

Parameters:

cmd (str) – The SLI command to be executed.

Raises:

kernel.NESTError – SLI errors are bubbled to the Python API as NESTErrors.

nest.ll_api.stack_checker(f)

Decorator to add stack checks to functions using PyNEST’s low-level API.

This decorator works only on functions. See check_stack() for the generic version for functions and classes.

Parameters:

f (function) – Function to decorate

Returns:

Decorated function

Return type:

function

Raises:

kernel.NESTError

nest.ll_api.take_array_index(node_collection, array)