Skip to content

Commit

Permalink
Use optionstable to display options and informs tables (#216)
Browse files Browse the repository at this point in the history
* moved default options and informs to staticmethod

* updated SNOPT docs

* updated ALPSO

* updated SLSQP

* updated PSQP

* updated NLPQLP

* updated NSGA2

* updated IPOPT

* updated CONMIN

* removed optimizertable

* bugfix after changing option from '' to EXT

* updated informs

* removed options description in comments

* pin a newer version of sphinx_mdolab_theme

* version bump
  • Loading branch information
ewu63 authored Mar 15, 2021
1 parent 9865d31 commit 83f1d05
Show file tree
Hide file tree
Showing 28 changed files with 550 additions and 427 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions.extend(["numpydoc", "ext.optimizertable", "sphinxcontrib.bibtex"])
extensions.extend(["numpydoc", "sphinxcontrib.bibtex"])

# mock import for autodoc
autodoc_mock_imports = ["baseclasses", "scipy", "numpy", "sqlitedict"]
Expand Down
148 changes: 0 additions & 148 deletions doc/ext/optimizertable.py

This file was deleted.

9 changes: 2 additions & 7 deletions doc/optimizers/ALPSO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ Augmented Lagrangian Particle Swarm Optimizer (ALPSO) is a PSO method that uses

Options
-------
.. optimizertable:: pyoptsparse.pyALPSO.pyALPSO.ALPSO
:type: options

Informs
-------
.. optimizertable:: pyoptsparse.pyALPSO.pyALPSO.ALPSO
:type: informs
.. optionstable:: pyoptsparse.pyALPSO.pyALPSO.ALPSO
:filename: optimizers/ALPSO_options.yaml

API
---
Expand Down
70 changes: 70 additions & 0 deletions doc/optimizers/ALPSO_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
SwarmSize:
desc: Number of Particles (Depends on Problem dimensions)
maxOuterIter:
desc: Maximum Number of Outer Loop Iterations (Major Iterations)
maxInnerIter:
desc: Maximum Number of Inner Loop Iterations (Minor Iterations)
minInnerIter:
desc: Minimum Number of Inner Loop Iterations (Dynamic Inner Iterations)
dynInnerIter:
desc: Dynamic Number of Inner Iterations Flag
stopCriteria:
desc: Stopping Criteria Flag (0 - maxIters, 1 - convergence)
stopIters:
desc: Consecutive Number of Iterations for which the Stopping Criteria must be Satisfied
etol:
desc: Absolute Tolerance for Equality constraints
itol:
desc: Absolute Tolerance for Inequality constraints
rtol:
desc: Relative Tolerance for Lagrange Multipliers
atol:
desc: Absolute Tolerance for Lagrange Function
dtol:
desc: Relative Tolerance in Distance of All Particles to Terminate (GCPSO)
printOuterIters:
desc: Number of Iterations Before Print Outer Loop Information
printInnerIters:
desc: Number of Iterations Before Print Inner Loop Information
rinit:
desc: Initial Penalty Factor
xinit:
desc: Initial Position Flag (0 - no position, 1 - position given)
vinit:
desc: Initial Velocity of Particles in Normalized [-1, 1] Design Space
vmax:
desc: Maximum Velocity of Particles in Normalized [-1, 1] Design Space
c1:
desc: Cognitive Parameter
c2:
desc: Social Parameter
w1:
desc: Initial Inertia Weight
w2:
desc: Final Inertia Weight
ns:
desc: Number of Consecutive Successes in Finding New Best Position of Best Particle Before Search Radius will be Increased (GCPSO)
nf:
desc: Number of Consecutive Failures in Finding New Best Position of Best Particle Before Search Radius will be Increased (GCPSO)
dt:
desc: Time step
vcrazy:
desc: Craziness Velocity (Added to Particle Velocity After Updating the Penalty Factors and Langangian Multipliers)
fileout:
desc: Flag to Turn On Output to filename
filename:
desc: We could probably remove fileout flag if filename or fileinstance is given
seed:
desc: Random Number Seed (0 - Auto-Seed based on time clock)
HoodSize:
desc: Number of Neighbours of Each Particle
HoodModel:
desc: Neighbourhood Model (dl/slring - Double/Single Link Ring, wheel - Wheel, Spatial - based on spatial distance, sfrac - Spatial Fraction)
HoodSelf:
desc: Selfless Neighbourhood Model (0 - Include Particle i in NH i, 1 - Don't Include Particle i)
Scaling:
desc: Design Variables Scaling Flag (0 - no scaling, 1 - scaling between [-1, 1])
parallelType:
desc: Type of parallelization
null: No parallel function evaluations
EXT: Use parallel function evaluations
8 changes: 2 additions & 6 deletions doc/optimizers/CONMIN.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ CONstrained function MINimization (CONMIN) is a gradient-based optimizer that us

Options
-------
.. optimizertable:: pyoptsparse.pyCONMIN.pyCONMIN.CONMIN
:type: options
.. optionstable:: pyoptsparse.pyCONMIN.pyCONMIN.CONMIN
:filename: optimizers/CONMIN_options.yaml

Informs
-------
.. optimizertable:: pyoptsparse.pyCONMIN.pyCONMIN.CONMIN
:type: informs

API
---
Expand Down
16 changes: 16 additions & 0 deletions doc/optimizers/CONMIN_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ITMAX:
desc: Maximum Number of Iterations
DELFUN:
desc: Objective Relative Tolerance
DABFUN:
desc: Objective Absolute Tolerance
ITRM:
desc: None
NFEASCT:
desc: None
IPRINT:
desc: Print Control (0 - None, 1 - Final, 2,3,4 - Debug)
IOUT:
desc: Output Unit Number
IFILE:
desc: Output File Name
7 changes: 4 additions & 3 deletions doc/optimizers/IPOPT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ Please refer to the `IPOPT website <https://coin-or.github.io/Ipopt/OPTIONS.html
The following are the options which are set by default within pyOptSparse.
All other options take the default value with IPOPT unless specified by the user.

.. optimizertable:: pyoptsparse.pyIPOPT.pyIPOPT.IPOPT
:type: options
.. optionstable:: pyoptsparse.pyIPOPT.pyIPOPT.IPOPT
:filename: optimizers/IPOPT_options.yaml


Informs
-------
.. optimizertable:: pyoptsparse.pyIPOPT.pyIPOPT.IPOPT
.. optionstable:: pyoptsparse.pyIPOPT.pyIPOPT.IPOPT
:type: informs

API
Expand Down
8 changes: 8 additions & 0 deletions doc/optimizers/IPOPT_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
print_level:
desc: Printing level
output_file:
desc: The name of the output file from IPOPT
option_file_name:
desc: The name of the options file passed to IPOPT
linear_solver:
desc: The linear solver used.
7 changes: 4 additions & 3 deletions doc/optimizers/NLPQLP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ The latest version supported is v4.2.2.

Options
-------
.. optimizertable:: pyoptsparse.pyNLPQLP.pyNLPQLP.NLPQLP
:type: options
.. optionstable:: pyoptsparse.pyNLPQLP.pyNLPQLP.NLPQLP
:filename: optimizers/NLPQLP_options.yaml


Informs
-------
.. optimizertable:: pyoptsparse.pyNLPQLP.pyNLPQLP.NLPQLP
.. optionstable:: pyoptsparse.pyNLPQLP.pyNLPQLP.NLPQLP
:type: informs

API
Expand Down
31 changes: 31 additions & 0 deletions doc/optimizers/NLPQLP_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
accuracy:
desc: Convergence accuracy
accuracyQP:
desc: Convergence accuracy for QP
stepMin:
desc: Minimum step length
maxFun:
desc: Maximum Number of Function Calls During Line Search
maxIt:
desc: Maximum Number of Iterations
maxNM:
desc: Maximum stack size for non-monotone line search
rho:
desc: Factor scaling identify for IFAIL=2
iPrint:
desc: Output Level
0: None
1: Final
2: Major
3: Major/Minor
4: Full
mode:
desc: Mode (0 - Normal Execution, 1 to 18 - See Manual)
iOut:
desc: Output Unit Number
lMerit:
desc: Merit Function Type (True - L2 Augmented Penalty, False - L1 Penalty)
lQl:
desc: QP Subproblem Solver (True - Quasi-Newton, False - Cholesky)
iFile:
desc: Output File Name
8 changes: 2 additions & 6 deletions doc/optimizers/NSGA2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ selection-based strategy

Options
-------
.. optimizertable:: pyoptsparse.pyNSGA2.pyNSGA2.NSGA2
:type: options
.. optionstable:: pyoptsparse.pyNSGA2.pyNSGA2.NSGA2
:filename: optimizers/NSGA2_options.yaml

Informs
-------
.. optimizertable:: pyoptsparse.pyNSGA2.pyNSGA2.NSGA2
:type: informs

API
---
Expand Down
22 changes: 22 additions & 0 deletions doc/optimizers/NSGA2_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PopSize:
desc: Population size
maxGen:
desc: Maximum number of generations
pCross_real:
desc: Probability of crossover of real variables
pMut_real:
desc: Probability of mutation of real variables
eta_c:
desc: Distribution index for crossover
eta_m:
desc: Distribution index for mutation
pCross_bin:
desc: Probability of crossover of binary variable
pMut_bin:
desc: Probability of mutation of binary variables
PrintOut:
desc: Flag to turn on output to filename
seed:
desc: Random Number Seed (0 - Auto-Seed based on time clock)
xinit:
desc: Use Initial Solution Flag (0 - random population, 1 - use given solution)
Loading

0 comments on commit 83f1d05

Please sign in to comment.