changeset 2560:2719d01b748e

app/pitot: fixed bug in pitot_conditiomn_builder.py There was a bug in the condition builder where if a user defined guesses, and then the code modified them, they would not be cleared at the end of the run. This could cuase the guesses to go crazy. Fixed now.
author Chris James <c.james4@uq.edu.au>
date Fri, 19 Jan 2018 12:13:53 +1000
parents 993be144ce8a
children d5a47b74cf1f
files app/pitot/pitot.py app/pitot/pitot_condition_builder.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/pitot/pitot.py	Thu Jan 11 19:08:05 2018 +1000
+++ b/app/pitot/pitot.py	Fri Jan 19 12:13:53 2018 +1000
@@ -314,7 +314,7 @@
 from pitot_output_utils import *
 from pitot_area_ratio_check import *
 
-VERSION_STRING = "11-Jan-2018"
+VERSION_STRING = "17-Jan-2018"
 
 DEBUG_PITOT = False
 
--- a/app/pitot/pitot_condition_builder.py	Thu Jan 11 19:08:05 2018 +1000
+++ b/app/pitot/pitot_condition_builder.py	Fri Jan 19 12:13:53 2018 +1000
@@ -10,7 +10,7 @@
 
 """
 
-VERSION_STRING = "10-Jan-2017"
+VERSION_STRING = "17-Jan-2017"
 
 import sys
 
@@ -522,7 +522,7 @@
         cfg, results = guess_modifier(cfg, results)
     
     cfg['filename'] = cfg['original_filename'] + '-test-{0}-result'.format(cfg['test_number'])
-    
+
     # some code here to make a copy of the stdout printouts for each test and store it
     
     import sys
@@ -575,6 +575,9 @@
         # and were added by the last run, so we remove them
         if variable not in cfg['cfg_original']:
             if variable in cfg: cfg.pop(variable)
+        # if the run failed, the guesses may have gone stupid, so reset them if the user had intial values...
+        if not cfg['last_run_successful'] and variable in cfg['cfg_original']:
+            cfg[variable] = cfg['cfg_original'][variable]
     
     # now we end the stream teeing here by pulling out the original stdout object
     # and overwriting the stream tee with that, then closing the log file