Repository: scipy/scipy

Issue:
BUG: callback defined both in options of scipy.optimize.minimize and in its signature
### Describe your issue.

The [documentation of version 1.8.0](https://docs.scipy.org/doc/scipy-1.8.0/html-scipyorg/reference/optimize.minimize-lbfgsb.html#optimize-minimize-lbfgsb) says that `callback` is one possible option of the L-BFGS-B solver, but setting that option causes an error :

```zsh
_minimize_lbfgsb() got multiple values for keyword argument 'callback'
```

Indeed, the [documentation also states](https://docs.scipy.org/doc/scipy-1.8.0/html-scipyorg/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize) that `callback` is an argument.

### Reproducing Code Example

```python
>>> import numpy as np
>>> from scipy.optimize import minimize
>>> def f(x):
...   return x*x
... 
>>> minimize(f, np.array([10]), method="L-BFGS-B", options={"callback": lambda xk: print(xk)})
```


### Error message

```shell
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vvargas-calderon/miniconda3/envs/zapata/lib/python3.8/site-packages/scipy/optimize/_minimize.py", line 681, in minimize
    res = _minimize_lbfgsb(fun, x0, args, jac, bounds,
TypeError: _minimize_lbfgsb() got multiple values for keyword argument 'callback'
```


### SciPy/NumPy/Python version information

1.8.0 1.21.6 sys.version_info(major=3, minor=8, micro=12, releaselevel='final', serial=0)


Discussion:
Hi @VolodyaCO, thank you for reporting.

The `options` which can be used for a given solver corresponds to the options which are in `options` for this solver.

E.g. for L-BFGS-B we have:

```python
scipy.optimize.minimize(fun, x0, args=(), method='L-BFGS-B', jac=None, bounds=None, tol=None, callback=None, options={'disp': None, 'maxcor': 10, 'ftol': 2.220446049250313e-09, 'gtol': 1e-05, 'eps': 1e-08, 'maxfun': 15000, 'maxiter': 15000, 'iprint': - 1, 'maxls': 20, 'finite_diff_rel_step': None})
```

Then from `minimize` you can use 
```python
options={'disp': None, 'maxcor': 10, 'ftol': 2.220446049250313e-09, 'gtol': 1e-05, 'eps': 1e-08, 'maxfun': 15000, 'maxiter': 15000, 'iprint': - 1, 'maxls': 20, 'finite_diff_rel_step': None}
```

Other parameters, like `callback`, are not in `options`. In your case you want:

```python
minimize(f, np.array([10]), method="L-BFGS-B", callback=lambda xk: print(xk))
```

To me it's then a documentation "issue". Do you have a suggestion to improve the wording?
@tupui thanks for your quick reply. I find it inconsistent that the signature of the documentation page does not have `callback` as an option, but the subsequent description of the options does include it. I think it should be removed:
<img width="754" alt="Screenshot 2022-05-06 at 8 45 52 AM" src="https://user-images.githubusercontent.com/31494271/167145478-0642b591-d08d-4a0c-999d-646910c29389.png">
 
Oh indeed I see 👍 Would you like to make a PR @VolodyaCO? (wait a bit until we figure this out 😅)
@andyfaff I think `Options` in the docstrings of `scipy/optimize/_lbfgsb_py.py:_minimize_lbfgsb` should only describes the `options`. I suppose this is general to other optimizers.
Yeah I can make the PR if you want me to... would that be in here (scipy/optimize/_lbfgsb_py.py:_minimize_lbfgsb)?
Thanks! Yes it should be. But please wait for a confirmation from @andyfaff.
Yes, I think it should be removed from the docstring in `_minimize_lbfgsb`.

Resolving patch:
diff --git a/scipy/optimize/_cobyla_py.py b/scipy/optimize/_cobyla_py.py
--- a/scipy/optimize/_cobyla_py.py
+++ b/scipy/optimize/_cobyla_py.py
@@ -207,9 +207,6 @@ def _minimize_cobyla(fun, x0, args=(), constraints=(),
         Maximum number of function evaluations.
     catol : float
         Tolerance (absolute) for constraint violations
-    callback : callable, optional
-        Called after each iteration, as ``callback(x)``, where ``x`` is the
-        current parameter vector.
 
     """
     _check_unknown_options(unknown_options)
diff --git a/scipy/optimize/_lbfgsb_py.py b/scipy/optimize/_lbfgsb_py.py
--- a/scipy/optimize/_lbfgsb_py.py
+++ b/scipy/optimize/_lbfgsb_py.py
@@ -250,9 +250,6 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
         ``iprint = 99``   print details of every iteration except n-vectors;
         ``iprint = 100``  print also the changes of active set and final x;
         ``iprint > 100``  print details of every iteration including x and g.
-    callback : callable, optional
-        Called after each iteration, as ``callback(xk)``, where ``xk`` is the
-        current parameter vector.
     maxls : int, optional
         Maximum number of line search steps (per iteration). Default is 20.
     finite_diff_rel_step : None or array_like, optional


Test patch: