Skip to content

Commit

Permalink
Update funcs with values from the cache (#302)
Browse files Browse the repository at this point in the history
* update funcs with values from the cache

* version bump

* fix case when self.cache['funcs'] does not exist yet
  • Loading branch information
ewu63 authored May 22, 2022
1 parent 7764324 commit 4ae37e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyoptsparse/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.8.2"
__version__ = "2.8.3"

from .pyOpt_history import History
from .pyOpt_variable import Variable
Expand Down
3 changes: 3 additions & 0 deletions pyoptsparse/pySNOPT/pySNOPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ def _snstop(self, ktcond, mjrprtlvl, minimize, n, nncon, nnobj, ns, itn, nmajor,
self.hist.write(callCounter, iterDict)
# this adds funcs etc. to the iterDict by fetching it from the history file
iterDict = self.hist.read(callCounter)
# update funcs with any additional entries that may be added
if "funcs" in self.cache.keys():
iterDict["funcs"].update(self.cache["funcs"])

# perform callback if requested
snstop_handle = self.getOption("snSTOP function handle")
Expand Down

0 comments on commit 4ae37e6

Please sign in to comment.