Skip to content

Commit 4ae37e6

Browse files
authored
Update funcs with values from the cache (#302)
* update funcs with values from the cache * version bump * fix case when self.cache['funcs'] does not exist yet
1 parent 7764324 commit 4ae37e6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pyoptsparse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "2.8.2"
1+
__version__ = "2.8.3"
22

33
from .pyOpt_history import History
44
from .pyOpt_variable import Variable

pyoptsparse/pySNOPT/pySNOPT.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,9 @@ def _snstop(self, ktcond, mjrprtlvl, minimize, n, nncon, nnobj, ns, itn, nmajor,
663663
self.hist.write(callCounter, iterDict)
664664
# this adds funcs etc. to the iterDict by fetching it from the history file
665665
iterDict = self.hist.read(callCounter)
666+
# update funcs with any additional entries that may be added
667+
if "funcs" in self.cache.keys():
668+
iterDict["funcs"].update(self.cache["funcs"])
666669

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

0 commit comments

Comments
 (0)