- Timestamp:
- 05/27/11 13:15:38 (12 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
examples/nineml_neuron.py (modified) (1 diff)
-
src/neuron/nineml.py (modified) (1 diff)
-
src/nineml/cells.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/nineml_neuron.py
r966 r968 22 22 celltype_cls = nineml_cell_type("if_cond_exp", 23 23 leaky_iaf.c1, 24 excitatory=coba_synapse.c1,25 inhibitory=deepcopy(coba_synapse.c1),24 inhibitory=coba_synapse.c1, 25 excitatory=deepcopy(coba_synapse.c1), 26 26 port_map={ 27 27 'excitatory': [('V', 'V'), ('Isyn', 'Isyn')], -
trunk/src/neuron/nineml.py
r966 r968 95 95 logger.debug("Writing NineML component to %s" % xml_file) 96 96 nineml_component.write(xml_file) 97 98 # TODO: This way of importing is a cludge. 99 # To fix it, where should general nmodl code-generation live? Under nineml.code_generation ? 100 from os.path import abspath, realpath, join 101 import nineml, sys 102 root = abspath(join(realpath(nineml.__path__[0]), "../../..")) 103 sys.path.append(join(root, "code_generation/nmodl")) 104 nineml2nmodl = __import__("9ml2nmodl") 105 106 nineml2nmodl.write_nmodl(xml_file, weight_variables) # weight variables should really come from xml file 97 98 from nineml2nmodl import write_nmodl 99 write_nmodl(xml_file, weight_variables) # weight variables should really come from xml file 107 100 p = subprocess.check_call(["nrnivmodl"]) 108 101 os.chdir(cwd) -
trunk/src/nineml/cells.py
r964 r968 224 224 dct["default_initial_values"] = dict((name, 0.0) 225 225 for name in combined_model.state_variables) 226 dct["synapse_types"] = dct["synapse_models"].keys() #really need an ordered dict226 dct["synapse_types"] = sorted(dct["synapse_models"]) # using alphabetical order may make things easier code generators 227 227 dct["injectable"] = True # need to determine this. How?? 228 228 dct["recordable"] = [port.name for port in combined_model.analog_ports] + ['spikes', 'regime'] … … 231 231 dct["model_name"] = name 232 232 logger.debug("Creating class '%s' with bases %s and dictionary %s" % (name, bases, dct)) 233 # generate and compile NMODL code, then load the mechanism into NEUORN233 # generate and compile code, then load the mechanism into the simulator 234 234 dct["builder"](combined_model, dct["weight_variables"]) # weight variables should really be stored within combined_model 235 235 return type.__new__(cls, name, bases, dct)
