diff --git a/doc/optimizers/pysnopt.rst b/doc/optimizers/pysnopt.rst index a89e65da..37a7b68c 100644 --- a/doc/optimizers/pysnopt.rst +++ b/doc/optimizers/pysnopt.rst @@ -16,8 +16,9 @@ Installation SNOPT is available for purchase `here `_. Upon purchase, you should receive a zip file. Within the zip file, there is a folder called ``src``. To use SNOPT with pyoptsparse, paste all files from ``src`` except snopth.f into ``pyoptsparse/pySNOPT/source``. -From v2.0 onwards, only SNOPT v7.7 is officially supported. +From v2.0 onwards, only SNOPT v7.7.x is officially supported. To use pyOptSparse with previous versions of SNOPT, please checkout release v1.2. +The current version of SNOPT being tested is v7.7.5, although v7.7.1 is also expected to work. Options diff --git a/pyoptsparse/__init__.py b/pyoptsparse/__init__.py index ffc7f57e..09ec7e31 100644 --- a/pyoptsparse/__init__.py +++ b/pyoptsparse/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.2.2" +__version__ = "2.3.0" from .pyOpt_history import History from .pyOpt_variable import Variable diff --git a/pyoptsparse/pyIPOPT/pyIPOPT.py b/pyoptsparse/pyIPOPT/pyIPOPT.py index 0a4f4c96..3625bf15 100644 --- a/pyoptsparse/pyIPOPT/pyIPOPT.py +++ b/pyoptsparse/pyIPOPT/pyIPOPT.py @@ -555,8 +555,6 @@ def _set_ipopt_options(self, nlp): def _on_setOption(self, name, value): """ Set Optimizer Option Value (Optimizer Specific Routine) - - Documentation last updated: May. 07, 2008 - Ruben E. Perez """ self.set_options.append([name, value]) diff --git a/pyoptsparse/pyOpt_optimizer.py b/pyoptsparse/pyOpt_optimizer.py index f1b0a162..cd940b98 100644 --- a/pyoptsparse/pyOpt_optimizer.py +++ b/pyoptsparse/pyOpt_optimizer.py @@ -821,7 +821,7 @@ def setOption(self, name, value=None): self.options[name] = [type(value), value] else: raise Error( - "Value type for option {} was incorrect. It was expecting type '{}' by received type '{}'".format( + "Value type for option {} was incorrect. It was expecting type '{}' but received type '{}'".format( name, self.options["defaults"][name][0], type(value) ) ) diff --git a/pyoptsparse/pySNOPT/pySNOPT.py b/pyoptsparse/pySNOPT/pySNOPT.py index d1819813..299c0d4a 100644 --- a/pyoptsparse/pySNOPT/pySNOPT.py +++ b/pyoptsparse/pySNOPT/pySNOPT.py @@ -76,6 +76,7 @@ def __init__(self, raiseError=True, *args, **kwargs): # SNOPT Other Tolerances Options "Crash tolerance": [float, 0.1], "Linesearch tolerance": [float, 0.9], # smaller for more accurate search + "Backoff factor": [float, 0.1], # backtracking factor for failed evaluations "Pivot tolerance": [float, 3.7e-11], # epsilon^(2/3) # SNOPT QP subproblems Options "QPSolver": [str, "Cholesky"], # Default: Cholesky @@ -88,6 +89,7 @@ def __init__(self, raiseError=True, *args, **kwargs): # SNOPT SQP method Options "Major iterations limit": [int, 1000], # or ncons if that is more "Minor iterations limit": [int, 500], # or 3*ncons if that is more + "Proximal iterations limit": [int, 200], # for solving the proximal point problem "Major step limit": [float, 2.0], "Superbasics limit": [int, None], # (n1 + 1, n1 = number of nonlinear variables) "Derivative level": [int, 3], # (NOT ALLOWED IN snOptA) @@ -224,7 +226,10 @@ def __init__(self, raiseError=True, *args, **kwargs): if raiseError: raise Error("There was an error importing the compiled snopt module") - self.set_options = [] + # any default options modified by pySNOPT goes here + self.set_options = [ + ["Proximal iterations limit", 10000], # very large # to solve proximal point problem to optimality + ] Optimizer.__init__(self, name, category, self.defOpts, self.informs, *args, **kwargs) # SNOPT need Jacobians in csc format @@ -663,10 +668,7 @@ def _set_snopt_options(self, iPrint, iSumm, cw, iw, rw): # Set Options from the local options dictionary # --------------------------------------------- inform = np.array([-1], np.intc) - for item in self.set_options: - name = item[0] - value = item[1] - + for name, value in self.set_options: if name == "iPrint" or name == "iSumm": continue @@ -701,8 +703,6 @@ def _set_snopt_options(self, iPrint, iSumm, cw, iw, rw): def _on_setOption(self, name, value): """ Set Optimizer Option Value (Optimizer Specific Routine) - - Documentation last updated: May. 07, 2008 - Ruben E. Perez """ self.set_options.append([name, value]) @@ -710,8 +710,6 @@ def _on_setOption(self, name, value): def _on_getOption(self, name): """ Get Optimizer Option Value (Optimizer Specific Routine) - - Documentation last updated: May. 07, 2008 - Ruben E. Perez """ pass @@ -723,8 +721,6 @@ def _on_getInform(self, infocode): Keyword arguments: ----------------- id -> STRING: Option Name - - Documentation last updated: May. 07, 2008 - Ruben E. Perez """ # @@ -741,8 +737,6 @@ def _on_getInform(self, infocode): def _on_flushFiles(self): """ Flush the Output Files (Optimizer Specific Routine) - - Documentation last updated: August. 09, 2009 - Ruben E. Perez """ #