Skip to content
Snippets Groups Projects
Commit 3571ed90 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Export to Py: if no file arg is given, then plot

parent 1230a55b
No related branches found
No related tags found
No related merge requests found
...@@ -435,9 +435,10 @@ std::string SimulationToPython::defineMain(SimulationToPython::EMainType mainTyp ...@@ -435,9 +435,10 @@ std::string SimulationToPython::defineMain(SimulationToPython::EMainType mainTyp
result = "if __name__ == '__main__': \n" result = "if __name__ == '__main__': \n"
" result = run_simulation()\n" " result = run_simulation()\n"
" import sys\n" " import sys\n"
" if len(sys.argv)<2:\n" " if len(sys.argv)>=2:\n"
" exit(\"File name is required\")\n" " ba.IntensityDataIOFactory.writeSimulationResult(result, sys.argv[1])\n"
" ba.IntensityDataIOFactory.writeSimulationResult(result, sys.argv[1])\n"; " else:\n"
" ba.plot_simulation_result(result, cmap='jet', aspect='auto')\n";
} else { } else {
throw std::runtime_error("SimulationToPython::defineMain() -> Error. Unknown main type."); throw std::runtime_error("SimulationToPython::defineMain() -> Error. Unknown main type.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment