1414from shutil import copyfile
1515from dacite import from_dict
1616import base64
17+ import jsonpickle
1718
1819import neuron
1920import numpy as np
@@ -266,6 +267,7 @@ def simulateNetPyNEModelInGeppetto(self, args):
266267 """
267268 allTrials = args .get ('allTrials' , True )
268269 use_prev_inst = args .get ('usePrevInst' , False )
270+ sim_id = args .get ('simId' , 0 )
269271
270272 try :
271273 experiment = experiments .get_current ()
@@ -289,17 +291,17 @@ def simulateNetPyNEModelInGeppetto(self, args):
289291 return self .simulate_single_model (experiment , use_prev_inst )
290292 except Exception :
291293 experiment .state = model .ExperimentState .ERROR
292- message = "Unknown error during simulation of Experiment"
294+ message = ( "Unknown error during simulation of Experiment. SimulationId %i" % sim_id )
293295 logging .exception (message )
294- return utils .getJSONError ("Unknown error during simulation of Experiment" , sys .exc_info ())
296+ return utils .getJSONError ("Unknown error during simulation of Experiment" , sys .exc_info (), { "sim_id" : sim_id } )
295297
296298 else :
297299 return self .simulate_single_model (use_prev_inst = use_prev_inst )
298300
299- except Exception :
300- message = "Error while simulating the NetPyNE model"
301+ except Exception as e :
302+ message = ( "Error while simulating the NetPyNE model: %s. SimulationId %f" % ( e , sim_id ))
301303 logging .exception (message )
302- return utils .getJSONError (message , sys .exc_info ())
304+ return utils .getJSONError (message , sys .exc_info (), { "sim_id" : sim_id } )
303305
304306 def _prepare_simulation_files (self , experiment : model .Experiment = None , use_prev_inst : bool = False ) -> str :
305307 """Prepares template files and netpyne model files for a single simulation """
@@ -647,6 +649,8 @@ def instantiateNetPyNEModel(self):
647649 saveData = sim .allSimData if hasattr (sim , 'allSimData' ) and 'spkt' in sim .allSimData .keys () and len (
648650 sim .allSimData ['spkt' ]) > 0 else False
649651
652+ #netcoded = jsonpickle.encode(self.netParams, unpicklable=False)
653+ #simcoded = jsonpickle.encode(self.simConfig, unpicklable=False)
650654 sim .create (self .netParams , self .simConfig )
651655 sim .net .defineCellShapes () # creates 3d pt for cells with stylized geometries
652656 sim .gatherData (gatherLFP = False )
0 commit comments