Skip to content

Commit

Permalink
patch for very old history files where metadata doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ewu63 committed Apr 4, 2022
1 parent dc6ec82 commit c55b4ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyoptsparse/postprocessing/OptView_baseclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def OptimizationHistory(self):
self.storedIters = False

# Raise warning for IPOPT's duplicated history
if db["metadata"]["optimizer"] == "IPOPT" and "iter" not in db["0"].keys():
if "metadata" in db and db["metadata"]["optimizer"] == "IPOPT" and "iter" not in db["0"].keys():
pyOptSparseWarning(
"The optimization history file has duplicated entries at every iteration, and the OptView plot is not correct. "
+ "Re-run the optimization with a current version of pyOptSparse to generate a correct history file."
Expand Down

0 comments on commit c55b4ea

Please sign in to comment.