FunctionImplementationContainer class¶
(Shortest import: from brian2.core.functions import FunctionImplementationContainer)
- class brian2.core.functions.FunctionImplementationContainer(function)[source]¶
Bases:
MappingHelper object to store implementations and give access in a dictionary-like fashion, using
CodeGeneratorimplementations as a fallback forCodeObjectimplementations.Methods
add_dynamic_implementation(target, code[, ...])Adds an "dynamic implementation" for this function.
add_implementation(target, code[, ...])add_numpy_implementation(wrapped_func[, ...])Add a numpy implementation to a
Function.Details
- add_dynamic_implementation(target, code, namespace=None, dependencies=None, availability_check=None, name=None, compiler_kwds=None)[source]¶
Adds an “dynamic implementation” for this function.
codeandnamespacearguments are expected to be callables that will be called inNetwork.before_runwith the owner of theCodeObjectas an argument. This allows to generate code that depends on details of the context it is run in, e.g. thedtof a clock.