@@ -1526,11 +1526,35 @@ else if (eofFormat.equals(EventWriter.FORMAT_ID_TIME))
15261526 main .append (bIndent +"self.initialized = True\n " );
15271527 main .append (bIndent +"sim_start = time.time()\n " );
15281528 main .append (bIndent +"print(\" Running a simulation of %sms (dt = %sms; seed=%s)\" % (h.tstop, h.dt, self.seed))\n \n " );
1529- main .append (bIndent +"h.run()\n \n " );
1529+ main .append (bIndent +"try:\n " );
1530+ main .append (bIndent +" h.run()\n " );
1531+ main .append (bIndent +"except Exception as e:\n " );
1532+ main .append (bIndent +" print(\" Exception running NEURON: %s\" % (e))\n " );
1533+ if (nogui )
1534+ {
1535+ main .append (bIndent +" quit()\n \n \n " );
1536+ }
1537+ else
1538+ {
1539+ main .append (bIndent +" return\n \n \n " );
1540+ }
1541+
15301542 main .append (bIndent +"self.sim_end = time.time()\n " );
15311543 main .append (bIndent +"self.sim_time = self.sim_end - sim_start\n " );
15321544 main .append (bIndent +"print(\" Finished NEURON simulation in %f seconds (%f mins)...\" %(self.sim_time, self.sim_time/60.0))\n \n " );
1533- main .append (bIndent +"self.save_results()\n \n \n " );
1545+
1546+ main .append (bIndent +"try:\n " );
1547+ main .append (bIndent +" self.save_results()\n " );
1548+ main .append (bIndent +"except Exception as e:\n " );
1549+ main .append (bIndent +" print(\" Exception saving results of NEURON simulation: %s\" % (e))\n " );
1550+ if (nogui )
1551+ {
1552+ main .append (bIndent +" quit()\n \n \n " );
1553+ }
1554+ else
1555+ {
1556+ main .append (bIndent +" return\n \n \n " );
1557+ }
15341558
15351559 main .append (" def advance(self):\n \n " );
15361560 main .append (bIndent +"if not self.initialized:\n " );
@@ -3793,15 +3817,15 @@ public static void main(String[] args) throws Exception
37933817
37943818 ArrayList <File > lemsFiles = new ArrayList <File >();
37953819
3796- lemsFiles .add (new File ("../neuroConstruct/osb/showcase/StochasticityShowcase/NeuroML2/LEMS_Inputs0.xml" ));
3820+ // lemsFiles.add(new File("../neuroConstruct/osb/showcase/StochasticityShowcase/NeuroML2/LEMS_Inputs0.xml"));
37973821 //lemsFiles.add(new File("../neuroConstruct/osb/invertebrate/celegans/CElegansNeuroML/CElegans/pythonScripts/c302/examples/LEMS_c302_C1_Oscillator.xml"));
37983822
37993823 //lemsFiles.add(new File("../neuroConstruct/osb/cerebellum/cerebellar_golgi_cell/SolinasEtAl-GolgiCell/NeuroML2/LEMS_KAHP_Test.xml"));
38003824 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex12_Net2.xml"));
38013825 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex16_Inputs.xml"));
38023826 //lemsFiles.add(new File("../neuroConstruct/osb/cerebellum/networks/VervaekeEtAl-GolgiCellNetwork/NeuroML2/LEMS_Pacemaking.xml"));
38033827 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex9_FN.xml"));
3804- // lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml"));
3828+ lemsFiles .add (new File ("../NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml" ));
38053829 /*
38063830 lemsFiles.add(new File("../neuroConstruct/osb/showcase/StochasticityShowcase/NeuroML2/LEMS_NoisyCurrentInput.xml"));
38073831 lemsFiles.add(new File("../neuroConstruct/osb/showcase/StochasticityShowcase/NeuroML2/LEMS_OUCurrentInput_test.xml"));
@@ -3811,8 +3835,8 @@ public static void main(String[] args) throws Exception
38113835 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex20a_AnalogSynapsesHH.xml"));
38123836 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex20_AnalogSynapses.xml"));
38133837 //lemsFiles.add(new File("../NeuroMLlite/neuromllite/LEMS_Sim_ten_cells_spikes_nest.xml"));
3814- lemsFiles .add (new File ("../NeuroMLlite/examples/test_files/test_inputs/LEMS_InputTest.xml" ));
3815- lemsFiles .add (new File ("../NeuroMLlite/neuromllite/LEMS_Sim_NML2_300_pointneurons.xml" ));
3838+ // lemsFiles.add(new File("../NeuroMLlite/examples/test_files/test_inputs/LEMS_InputTest.xml"));
3839+ // lemsFiles.add(new File("../NeuroMLlite/neuromllite/LEMS_Sim_NML2_300_pointneurons.xml"));
38163840
38173841 //
38183842 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex26_Weights.xml"));
@@ -3855,7 +3879,7 @@ public static void main(String[] args) throws Exception
38553879
38563880 //lemsFiles.add(new File("../neuroConstruct/osb/cerebral_cortex/networks/ACnet2/neuroConstruct/generatedNeuroML2/LEMS_StimuliTest.xml"));
38573881 //lemsFiles.add(new File("../git/alex-neuroml-test/LEMS_sim.xml"));
3858- lemsFiles .add (new File ("../NeuroML2/LEMSexamples/LEMS_NML2_Ex6_NMDA.xml" ));
3882+ // lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex6_NMDA.xml"));
38593883 //lemsFiles.add(new File("../NeuroML2/LEMSexamples/LEMS_NML2_Ex25_MultiComp.xml"));
38603884 /*
38613885 lemsFiles.add(new File("../neuroConstruct/osb/showcase/NetPyNEShowcase/NeuroML2/LEMS_M1.xml"));
0 commit comments