Skip to content

Commit

Permalink
adjust SNOPT option formatting (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewu63 authored Jun 8, 2023
1 parent 7101350 commit fe2a819
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doc/optimizers/SNOPT_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Total real workspace:
User-specified values are not overwritten.
Save major iteration variables:
desc: >
desc: |
This option is unique to the Python wrapper, and takes a list of values which can be saved at each major iteration to the History file.
The possible values are
Expand Down
26 changes: 11 additions & 15 deletions pyoptsparse/pySNOPT/pySNOPT.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
pySNOPT - A variation of the pySNOPT wrapper specificially designed to
pySNOPT - A variation of the pySNOPT wrapper specifically designed to
work with sparse optimization problems.
"""
# Standard Python modules
Expand Down Expand Up @@ -57,14 +57,10 @@ def _import_snopt_from_path(path):

class SNOPT(Optimizer):
"""
SNOPT Optimizer Class - Inherited from Optimizer Abstract Class
SNOPT Optimizer Class
"""

def __init__(self, raiseError=True, options: Dict = {}):
"""
SNOPT Optimizer Class Initialization
"""

name = "SNOPT"
category = "Local Optimizer"
defOpts = self._getDefaultOptions()
Expand Down Expand Up @@ -227,20 +223,20 @@ def __call__(
None which will use SNOPT's own finite differences which
are vastly superior to the pyOptSparse implementation. To
explicitly use pyOptSparse gradient class to do the
derivatives with finite differences use 'FD'. 'sens'
may also be 'CS' which will cause pyOptSpare to compute
derivatives with finite differences use `FD`. `sens`
may also be `CS` which will cause pyOptSpare to compute
the derivatives using the complex step method. Finally,
'sens' may be a python function handle which is expected
`sens` may be a python function handle which is expected
to compute the sensitivities directly. For expensive
function evaluations and/or problems with large numbers of
design variables this is the preferred method.
sensStep : float
Set the step size to use for design variables. Defaults to
1e-6 when sens is 'FD' and 1e-40j when sens is 'CS'.
``1e-6`` when sens is `FD` and ``1e-40j`` when sens is `CS`.
sensMode : str
Use 'pgc' for parallel gradient computations. Only
Use `pgc` for parallel gradient computations. Only
available with mpi4py and each objective evaluation is
otherwise serial
Expand All @@ -251,8 +247,8 @@ def __call__(
hotStart : str
File name of the history file to "replay" for the
optimization. The optimization problem used to generate
the history file specified in 'hotStart' must be
**IDENTICAL** to the currently supplied 'optProb'. By
the history file specified in `hotStart` must be
**IDENTICAL** to the currently supplied `optProb`. By
identical we mean, **EVERY SINGLE PARAMETER MUST BE
IDENTICAL**. As soon as he requested evaluation point
from SNOPT does not match the history, function and
Expand All @@ -277,7 +273,7 @@ def __call__(
sol : Solution object
The optimization solution
restartDict : dict
If 'Return work arrays' is True, a dictionary of arrays is also returned
If `Return work arrays` is True, a dictionary of arrays is also returned
"""
self.startTime = time.time()
self.callCounter = 0
Expand Down Expand Up @@ -631,7 +627,7 @@ def _snstop(self, ktcond, mjrprtlvl, minimize, n, nncon, nnobj, ns, itn, nmajor,
"""
This routine is called every major iteration in SNOPT, after solving QP but before line search
We use it to determine the correct major iteration counting, and save some parameters in the history file.
If 'snSTOP function handle' is set to a function handle, then it is called at the end of this function.
If `snSTOP function handle` is set to a function handle, then it is called at the end of this function.
Returns
-------
Expand Down

0 comments on commit fe2a819

Please sign in to comment.