Exceptions module

exception nest.lib.hl_api_exceptions.NESTError(message)

Bases: Exception

Base exception class for all NEST exceptions.

class nest.lib.hl_api_exceptions.NESTErrors

Bases: object

Namespace for NEST exceptions, including dynamically created classes from SLI.

Dynamic exception creation is through __getattr__ defined in the metaclass NESTMappedException.

exception NESTError(message)

Bases: Exception

Base exception class for all NEST exceptions.

exception PyNESTError(message)

Bases: NESTError

Exceptions produced from Python/Cython code.

exception SLIException(commandname, errormessage, errorname='SLIException')

Bases: NESTError

Base class for all exceptions coming from sli.

default_parent

alias of SLIException

static init(parent, errorname)

Static class method to construct init’s for SLIException children.

Construct our new init with closure on errorname (as a default value) and parent. The default value allows the __init__ to be chained and set by the leaf child. This also moves the paramerization of __init__ away from the class construction logic and next to the SLIException init.

Parameters:

parent: the ancestor of the class needed to properly walk up the MRO (not possible with super() or
super(type,…) because of the dynamic creation of the function

(used as a closure on the constructed __init__).

errorname: the class name for information purposes

internally (used as a closure on the constructed __init__).

parents = {'ArgumentType': 'InterpreterError', 'BadDelay': 'KernelException', 'BadParameter': 'KernelException', 'BadParameterValue': 'SLIException', 'BadProperty': 'KernelException', 'DictError': 'InterpreterError', 'DimensionMismatch': 'KernelException', 'DistributionError': 'KernelException', 'EntryTypeMismatch': 'DictError', 'GSLSolverFailure': 'KernelException', 'IOError': 'SLIException', 'IllegalConnection': 'KernelException', 'IncompatibleReceptorType': 'KernelException', 'InexistentConnection': 'KernelException', 'InvalidDefaultResolution': 'KernelException', 'InvalidTimeInModel': 'KernelException', 'KeyError': 'KernelException', 'LocalNodeExpected': 'KernelException', 'MUSICChannelAlreadyMapped': 'KernelException', 'MUSICChannelUnknown': 'KernelException', 'MUSICPortAlreadyPublished': 'KernelException', 'MUSICPortHasNoWidth': 'KernelException', 'MUSICPortUnconnected': 'KernelException', 'MUSICPortUnknown': 'KernelException', 'MUSICSimulationHasRun': 'KernelException', 'ModelInUse': 'KernelException', 'NewModelNameExists': 'KernelException', 'NoThreadSiblingsAvailable': 'KernelException', 'NodeWithProxiesExpected': 'KernelException', 'NumericalInstability': 'KernelException', 'RangeCheck': 'InterpreterError', 'StackUnderflow': 'InterpreterError', 'StepMultipleRequired': 'KernelException', 'SystemSignal': 'InterpreterError', 'TimeMultipleRequired': 'KernelException', 'TypeMismatch': 'InterpreterError', 'UnaccessedDictionaryEntry': 'DictError', 'UndefinedName': 'DictError', 'UnexpectedEvent': 'KernelException', 'UnknownModelName': 'KernelException', 'UnknownNode': 'KernelException', 'UnknownPort': 'KernelException', 'UnknownReceptorType': 'KernelException', 'UnknownSynapseType': 'KernelException', 'UnknownThread': 'KernelException', 'UnsupportedEvent': 'KernelException'}
source = 'SLI'
class nest.lib.hl_api_exceptions.NESTMappedException

Bases: type

Metaclass for exception namespace that dynamically creates exception classes.

If a class (self) of this (meta)-type has an unknown attribute requested, __getattr__ defined below gets called, creating a class with that name (the error name) and with an __init__ taking commandname and errormessage (as created in the source) which is a closure on the parent and errorname as well, with a parent of default type (self.default_parent) or self.parents[errorname] if defined.