Name: PyDynamics
Purpose: This is a virtual base class that is inherited by dynamics that are coded in Python. Like Dyanamics is does not do anything on its own. Users are required to proved methods and members to implement their own requirements (see below).
Provided by: _p3
Source: dyn_py.c
Examples: test_pynet.py
Inherits: Dynamics
Constructor: PyDynamics(c) where c is a Cell or Compartment object. If c is a Cell the PyDynamics is added to the first compartment in the Cell.
Provides:
NameTypeAttributesDescription
ownerCompartmentROthe Compartment owning this Dynamics
traceboolRWflag to turn tracing on for this dynamics
Implementation: Users inherit this class (ie class MyDynamics(PyDynamics):) and provided some or all of the following methods. If the dynamics contains state the state and associated variable names are provided in static lists of strings. Exceptions thrown once parplex terminate the run.
NameTypeAttributesPrototypeDescription
derivsmethodreturns Nonederivs(self, t)called internally to implement the derivative function
currentmethodreturns floatcurrent(self, t)called internally to implement the derivative function
enqmethodreturns Noneenq(self, t, strength)called in user code to exogenously trigger this dynamics (eg exogenous synaptic events)
deletermethodreturns Nonedeleter(self, synapse, cellid, windowid)called internally when an synaptic event needs to be retracted from this cell (used in parallel runs)
cleanupmethodreturns Nonecleanup(self, gd)called internally at the end of window when it is appropsiate to perform memory management and other cleanup operations. The current time is gd.windowStart+gd.window
acceptormethodreturns Noneacceptor(self, synapse, strength, windowID)called when a synaptic event triggers this dynamics
stateVarsstatic list of stringsthe names of the state variables as used in the methods
derivVarsstatic list of stringsthe names of the derivatives of the state variables as used in the methods (updated in derivs
traceVarsstatic list of stringsthe names of the lists containing trace history of the dynamics variables, typically used in the gd.trace_handler callback.