Skip to content

Commit c55b4ea

Browse files
committed
patch for very old history files where metadata doesn't exist
1 parent dc6ec82 commit c55b4ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyoptsparse/postprocessing/OptView_baseclass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def OptimizationHistory(self):
161161
self.storedIters = False
162162

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

0 commit comments

Comments
 (0)