From 1a73e52c8210a44b576dee79bd2d79109d3437fa Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de> Date: Tue, 24 Nov 2020 18:05:12 +0100 Subject: [PATCH] ExportToPython: corrected formatting errors --- Core/Export/SimulationToPython.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp index db09a2c0bef..241f6d6efdb 100644 --- a/Core/Export/SimulationToPython.cpp +++ b/Core/Export/SimulationToPython.cpp @@ -155,7 +155,7 @@ std::string SimulationToPython::defineDetector(const ISimulation* simulation) co } result << ")\n"; } else if (const auto* const det = dynamic_cast<const RectangularDetector*>(detector)) { - result << pyfmt::indent() << "\n"; + result << "\n"; result << pyfmt::indent() << "detector = ba.RectangularDetector(" << det->getNbinsX() << ", " << pyfmt::printDouble(det->getWidth()) << ", " << det->getNbinsY() << ", " << pyfmt::printDouble(det->getHeight()) << ")\n"; @@ -205,7 +205,7 @@ std::string SimulationToPython::defineDetector(const ISimulation* simulation) co << printFunc(detector)(detector->regionOfInterest()->getXup()) << ", " << printFunc(detector)(detector->regionOfInterest()->getYup()) << ")\n"; } - result << pyfmt::indent() << "\n"; + result << "\n"; return result.str(); } @@ -408,11 +408,11 @@ std::string SimulationToPython::defineBackground(const ISimulation* simulation) std::string SimulationToPython::defineMain(SimulationToPython::EMainType mainType) { std::string result; if (mainType == RUN_SIMULATION) { - result = "if __name__ == '__main__': \n" + result = "if __name__ == '__main__':\n" " result = run_simulation()\n" " ba.plot_simulation_result(result)\n"; } else if (mainType == SAVE_DATA) { - result = "if __name__ == '__main__': \n" + result = "if __name__ == '__main__':\n" " result = run_simulation()\n" " import sys\n" " if len(sys.argv)>=2:\n" -- GitLab