File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import logging
12import shutil
23import subprocess
34import os
@@ -29,24 +30,27 @@ def is_loaded_mechanisms():
2930def loadModMechFiles (compileMod , modFolder , forceRecompile = False ):
3031 # Create Symbolic link
3132
32- if compileMod :
3333 try :
34+
3435 owd = os .getcwd ()
35- modPath = os .path .join (str (modFolder ), "x86_64" )
36+ if compileMod :
37+
38+ compiledModPath = os .path .join (str (modFolder ), "x86_64" )
3639
37- if os .path .exists (modPath ):
38- if forceRecompile :
39- shutil .rmtree (modPath )
40- else :
41- return
40+ if os .path .exists (compiledModPath ) and forceRecompile :
41+ logging .info ("Forcing mod files to recompile in %s" % modFolder )
42+ shutil .rmtree (compiledModPath )
4243
43- os .chdir (modFolder )
44- subprocess .call (["nrnivmodl" ])
45- os .chdir ('..' )
44+ if not os .path .exists (compiledModPath ):
45+ logging .info ("Compiling mod files in %s" % modFolder )
46+ os .chdir (modFolder )
47+ subprocess .call (["nrnivmodl" ])
48+ os .chdir ('..' )
4649
4750 try :
4851 neuron .load_mechanisms (str (modFolder ))
4952 except :
53+ logging .exception ("Error loading mechanisms" )
5054 raise
5155 finally :
5256 os .chdir (owd )
Original file line number Diff line number Diff line change 4646
4747os .chdir (constants .NETPYNE_WORKDIR_PATH )
4848
49- neuron .nrn_dll_loaded .append (os .path .join (NETPYNE_WORKDIR_PATH , 'mod' )) # Avoids to load workspace modfiles twice
5049
5150class NetPyNEGeppetto :
5251
@@ -581,7 +580,7 @@ def importModel(self, modelParameters):
581580 # Only on import or better before every simulation or network instantiation?
582581 sim .initialize ()
583582 return utils .getJSONReply ()
584- except Exception :
583+ except :
585584 message = "Error while importing the NetPyNE model"
586585 logging .exception (message )
587586 return utils .getJSONError (message , sys .exc_info ())
Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ export default (store) => (next) => (action) => {
400400
401401 const params = {
402402 modFolder : dirname + '/mod' ,
403- loadMod : false ,
403+ loadMod : true ,
404404 compileMod : true ,
405405 forceRecompile : false ,
406406
You can’t perform that action at this time.
0 commit comments