Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: optimize: remove inadvertent block quote indentation #13106

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scipy/optimize/_basinhopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ def basinhopping(func, x0, niter=100, T=1.0, stepsize=0.5,
Extra keyword arguments to be passed to the local minimizer
``scipy.optimize.minimize()`` Some important options could be:

method : str
The minimization method (e.g. ``"L-BFGS-B"``)
args : tuple
Extra arguments passed to the objective function (``func``) and
its derivatives (Jacobian, Hessian).
method : str
The minimization method (e.g. ``"L-BFGS-B"``)
args : tuple
Extra arguments passed to the objective function (``func``) and
its derivatives (Jacobian, Hessian).

take_step : callable ``take_step(x)``, optional
Replace the default step-taking routine with this routine. The default
Expand Down
10 changes: 6 additions & 4 deletions scipy/optimize/_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ class NonlinearConstraint(object):
where element (i, j) is the partial derivative of f[i] with
respect to x[j]). The keywords {'2-point', '3-point',
'cs'} select a finite difference scheme for the numerical estimation.
A callable must have the following signature:
``jac(x) -> {ndarray, sparse matrix}, shape (m, n)``.
A callable must have the following signature::

jac(x) -> {ndarray, sparse matrix}, shape (m, n)

Default is '2-point'.
hess : {callable, '2-point', '3-point', 'cs', HessianUpdateStrategy, None}, optional
Method for computing the Hessian matrix. The keywords
Expand All @@ -57,8 +59,8 @@ class NonlinearConstraint(object):
`HessianUpdateStrategy` interface can be used to approximate the
Hessian. Currently available implementations are:

- `BFGS` (default option)
- `SR1`
- `BFGS` (default option)
- `SR1`

A callable must return the Hessian matrix of ``dot(fun, v)`` and
must have the following signature:
Expand Down
36 changes: 18 additions & 18 deletions scipy/optimize/_differentialevolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ def differential_evolution(func, bounds, args=(), strategy='best1bin',
strategy : str, optional
The differential evolution strategy to use. Should be one of:

- 'best1bin'
- 'best1exp'
- 'rand1exp'
- 'randtobest1exp'
- 'currenttobest1exp'
- 'best2exp'
- 'rand2exp'
- 'randtobest1bin'
- 'currenttobest1bin'
- 'best2bin'
- 'rand2bin'
- 'rand1bin'
- 'best1bin'
- 'best1exp'
- 'rand1exp'
- 'randtobest1exp'
- 'currenttobest1exp'
- 'best2exp'
- 'rand2exp'
- 'randtobest1bin'
- 'currenttobest1bin'
- 'best2bin'
- 'rand2bin'
- 'rand1bin'

The default is 'best1bin'.
maxiter : int, optional
Expand Down Expand Up @@ -122,12 +122,12 @@ def differential_evolution(func, bounds, args=(), strategy='best1bin',
Specify which type of population initialization is performed. Should be
one of:

- 'latinhypercube'
- 'random'
- array specifying the initial population. The array should have
shape ``(M, len(x))``, where M is the total population size and
len(x) is the number of parameters.
`init` is clipped to `bounds` before use.
- 'latinhypercube'
- 'random'
- array specifying the initial population. The array should have
shape ``(M, len(x))``, where M is the total population size and
len(x) is the number of parameters.
`init` is clipped to `bounds` before use.

The default is 'latinhypercube'. Latin Hypercube sampling tries to
maximize coverage of the available parameter space. 'random'
Expand Down
6 changes: 3 additions & 3 deletions scipy/optimize/_dual_annealing.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ def dual_annealing(func, bounds, args=(), maxiter=1000,
latest minimum found, and ``context`` has value in [0, 1, 2], with the
following meaning:

- 0: minimum detected in the annealing process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the documentation could do with a little polishing in this section, but that's out of scope of this PR.

- 1: detection occurred in the local search process.
- 2: detection done in the dual annealing process.
- 0: minimum detected in the annealing process.
- 1: detection occurred in the local search process.
- 2: detection done in the dual annealing process.

If the callback implementation returns True, the algorithm will stop.
x0 : ndarray, shape(n,), optional
Expand Down
40 changes: 24 additions & 16 deletions scipy/optimize/_linprog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ def linprog_verbose_callback(res):
feasible solution is sought and the T has an additional row
representing an alternate objective function.
status : int
An integer representing the exit status of the optimization::
An integer representing the exit status of the optimization:

0 : Optimization terminated successfully
1 : Iteration limit reached
2 : Problem appears to be infeasible
3 : Problem appears to be unbounded
4 : Serious numerical difficulties encountered
``0`` : Optimization terminated successfully
mdhaber marked this conversation as resolved.
Show resolved Hide resolved

``1`` : Iteration limit reached

``2`` : Problem appears to be infeasible

``3`` : Problem appears to be unbounded

``4`` : Serious numerical difficulties encountered

nit : int
The number of iterations performed.
Expand Down Expand Up @@ -142,13 +146,17 @@ def linprog_terse_callback(res):
feasible solution is sought and the T has an additional row
representing an alternate objective function.
status : int
An integer representing the exit status of the optimization::
An integer representing the exit status of the optimization:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another thing that shows up occasionally - rendering return code lists as literal blocks. One could argue that it's supposed to be that way, but I think it's more important for it to be consistent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Literal blocks are easier to align on the screen, otherwise you get wonky lists which look quite ugly.

Copy link
Contributor Author

@mdhaber mdhaber Nov 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Literal blocks are easier to align on the screen, otherwise you get wonky lists which look quite ugly.

I agree that the bullets are too far to the left, but isn't that more of a problem with the Sphinx theme? I think that's something we can (and should) fix across the board with a change in the right place.

This change isn't being displayed correctly.

Thanks. It was supposed to be more like:
image

I'll fix.

Copy link
Contributor Author

@mdhaber mdhaber Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


``0`` : Optimization terminated successfully

0 : Optimization terminated successfully
1 : Iteration limit reached
2 : Problem appears to be infeasible
3 : Problem appears to be unbounded
4 : Serious numerical difficulties encountered
``1`` : Iteration limit reached

``2`` : Problem appears to be infeasible

``3`` : Problem appears to be unbounded

``4`` : Serious numerical difficulties encountered

nit : int
The number of iterations performed.
Expand Down Expand Up @@ -263,10 +271,10 @@ def linprog(c, A_ub=None, b_ub=None, A_eq=None, b_eq=None,

``4`` : Numerical difficulties encountered.

nit : int
The current iteration number.
message : str
A string descriptor of the algorithm status.
nit : int
The current iteration number.
message : str
A string descriptor of the algorithm status.

Callback functions are not currently supported by the HiGHS methods.

Expand Down
Loading