From 366ff6529af9d743071810326913716ba36d77f6 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Thu, 27 Sep 2018 08:41:50 -0500 Subject: [PATCH] Add some informational messages from CalcSoilSurfTemp --- workflows/calc_soil_surface_temp.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workflows/calc_soil_surface_temp.py b/workflows/calc_soil_surface_temp.py index 82ec660460b..30e87de81d7 100644 --- a/workflows/calc_soil_surface_temp.py +++ b/workflows/calc_soil_surface_temp.py @@ -63,6 +63,7 @@ def main(self, run_directory, file_name, args): csst_out = os.path.join(run_directory, 'CalcSoilSurfTemp.out') if os.path.exists(csst_out): + self.callback("Removing previous output file") os.remove(csst_out) if os.path.exists(out_file_path): @@ -76,8 +77,10 @@ def main(self, run_directory, file_name, args): ) # run E+ and gather (for now fake) data + self.callback("Running CalcSoilSurfTemp!") p1 = Popen([calc_soil_surf_temp_binary, file_name], stdout=PIPE, stdin=PIPE, cwd=run_directory) p1.communicate(input=b'1\n1\n') + self.callback("CalcSoilSurfTemp Completed!") if not os.path.exists(csst_out): return EPLaunchWorkflowResponse1( @@ -97,6 +100,7 @@ def main(self, run_directory, file_name, args): os.remove(csst_out) try: + self.callback("Processing output file...") with open(out_file_path, 'r') as f: lines = f.readlines() avg_temp = float(lines[1][40:-1]) @@ -107,12 +111,14 @@ def main(self, run_directory, file_name, args): ColumnNames.AmplitudeSurfTemp: amp_temp, ColumnNames.PhaseConstant: phase_constant } + self.callback(" ...DONE!") return EPLaunchWorkflowResponse1( success=True, message="Ran EnergyPlus OK for file: %s!" % file_name, column_data=column_data ) except Exception: # noqa -- there could be lots of issues here, file existence, file contents, float conversion + self.callback(" ...FAILED!") return EPLaunchWorkflowResponse1( success=False, message="CalcSoilSurfTemp seemed to run, but post processing failed for file: %s!" % full_file_path,