From 4ae37e62dd71311dabf693132b970925677066b8 Mon Sep 17 00:00:00 2001 From: Neil Wu <602725+nwu63@users.noreply.github.com> Date: Sat, 21 May 2022 23:01:30 -0400 Subject: [PATCH] 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 --- pyoptsparse/__init__.py | 2 +- pyoptsparse/pySNOPT/pySNOPT.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyoptsparse/__init__.py b/pyoptsparse/__init__.py index bf33ccde..bc8d8a80 100644 --- a/pyoptsparse/__init__.py +++ b/pyoptsparse/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.8.2" +__version__ = "2.8.3" from .pyOpt_history import History from .pyOpt_variable import Variable diff --git a/pyoptsparse/pySNOPT/pySNOPT.py b/pyoptsparse/pySNOPT/pySNOPT.py index 640faadf..3c6f3e63 100644 --- a/pyoptsparse/pySNOPT/pySNOPT.py +++ b/pyoptsparse/pySNOPT/pySNOPT.py @@ -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")