Skip to content

Commit

Permalink
handle possibility best indices and best_optval are None to avoid en …
Browse files Browse the repository at this point in the history
…error (#1159)
  • Loading branch information
sotorrio1 authored Sep 12, 2023
1 parent 0d1e950 commit baa13c8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions foqus_lib/gui/sdoe/sdoeSetupFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2576,11 +2576,17 @@ def runOdoe(self):
)
time_list.append(time.time() - t0)
self.resultMessage += "Results for Run #%d:\n" % (nr + 1)
self.resultMessage += "Best Design(s): %s\n" % best_indices
self.resultMessage += "Best %s-Optimality Value: %f\n\n" % (
optCriterion,
best_optval,
)
if best_indices is not None:
self.resultMessage += "Best Design(s): %s\n" % best_indices
else:
self.resultMessage += "Best Design(s): Not Found\n"
if best_optval is not None:
self.resultMessage += "Best %s-Optimality Value: %f\n\n" % (
optCriterion,
best_optval,
)
else:
self.resultMessage += "Best %s-Optimality Value: Not Found\n\n"

# Save results to text file
resultsFile = os.path.join(outdir, "odoe_results.txt")
Expand Down

0 comments on commit baa13c8

Please sign in to comment.