Utility methods for translating Python dicts into hoc template objects or global variables in NEURON accessible to hoc.
@author: - Thomas McTavish
Convert a python boolean into a global hoc double value. :param hoc: A hoc instance as attained by from neuron import h. :param key: Name of the variable :param val: True or False
Translate numbers, strings, and boolean values of a Python dictionary into global variables in NEURON. The keys of the dict become the variable names in hoc. If the hoc variables already exist, they will be overwritten. All values that are boolean, ints, or floats are translated to a double in hoc. Strings are treated as hoc strdef objects. Any other types of the dict are ignored.
Parameters: |
|
---|
Convert a 1D list of ints or floats into a global hoc Vector. :param hoc: A hoc instance as attained by from neuron import h. :param key: Name of the variable :param val: 1D list of ints or floats
Convert a python number into a global hoc double value. :param hoc: A hoc instance as attained by from neuron import h. :param key: Name of the variable :param val: Python integer or float