Repository: scipy/scipy
File: scipy/optimize/_differentialevolution.py (Python)

Code before:
        The callback also supports a signature like::

            callback(x, convergence: float=val)

        ``val`` represents the fractional value of the population convergence.
        When ``val`` is greater than ``1.0``, the function halts.

        Introspection is used to determine which of the signatures is invoked.

        Global minimization will halt if the callback raises ``StopIteration``
        or returns ``True``; any polishing is still carried out.

        .. versionchanged:: 1.12.0
            callback accepts the ``intermediate_result`` keyword.

    polish : {bool, callable}, optional
        If True (default), then `scipy.optimize.minimize` with the `L-BFGS-B`
        method is used to polish the best population member at the end, which
        can improve the minimization slightly. If a constrained problem is
        being studied then the `trust-constr` method is used instead. For large
        problems with many constraints, polishing can take a long time due to
        the Jacobian computations.
        Alternatively supply a callable that has a `minimize`-like signature,
        ``polish_func(func, x0, **kwds)`` and returns an `OptimizeResult`. This
        allows the user to have fine control over how the polishing occurs.
        `bounds` and `constraints` will be present in `kwds`. Extra keywords
        could be supplied to `polish_func` using `functools.partial`. It is the
        user's responsibility to ensure that the polishing function obeys
        bounds, any constraints (including integrality constraints), and that
        appropriate attributes are set in the `OptimizeResult`, such as `fun`,
        `x`, `nfev`, `jac`.

        .. versionchanged:: 1.15.0
            If `workers` is specified then the map-like callable that wraps
            `func` is supplied to `minimize` instead of it using `func`
            directly. This allows the caller to control how and where the
            invocations actually run.

        .. versionchanged:: 1.17.0
            A callable obeying the `minimize` signature can be supplied to
            polish the best population member.

    init : str or array-like, optional
        Specify which type of population initialization is performed. Should be
        one of:

        - 'latinhypercube'
        - 'sobol'
        - 'halton'
        - 'random'
        - array specifying the initial population. The array should have

Review comment (suggestion):
```suggestion
        `bounds` and `constraints` will be present in ``kwds``. Extra keywords
```
(not a parameter of `differential_evolution`)

Code after:
        The callback also supports a signature like::

            callback(x, convergence: float=val)

        ``val`` represents the fractional value of the population convergence.
        When ``val`` is greater than ``1.0``, the function halts.

        Introspection is used to determine which of the signatures is invoked.

        Global minimization will halt if the callback raises ``StopIteration``
        or returns ``True``; any polishing is still carried out.

        .. versionchanged:: 1.12.0
            callback accepts the ``intermediate_result`` keyword.

    polish : {bool, callable}, optional
        If True (default), then `scipy.optimize.minimize` with the `L-BFGS-B`
        method is used to polish the best population member at the end, which
        can improve the minimization slightly. If a constrained problem is
        being studied then the `trust-constr` method is used instead. For large
        problems with many constraints, polishing can take a long time due to
        the Jacobian computations.
        Alternatively supply a callable that has a `minimize`-like signature,
        ``polish_func(func, x0, **kwds)`` and returns an `OptimizeResult`. This
        allows the user to have fine control over how the polishing occurs.
        `bounds` and `constraints` will be present in ``kwds``. Extra keywords
        could be supplied to `polish_func` using `functools.partial`. It is the
        user's responsibility to ensure that the polishing function obeys
        bounds, any constraints (including integrality constraints), and that
        appropriate attributes are set in the `OptimizeResult`, such as ``fun``,
        ``x``, ``nfev``, ``jac``.

        .. versionchanged:: 1.15.0
            If `workers` is specified then the map-like callable that wraps
            `func` is supplied to `minimize` instead of it using `func`
            directly. This allows the caller to control how and where the
            invocations actually run.

        .. versionchanged:: 1.17.0
            A callable obeying the `minimize` signature can be supplied to
            polish the best population member.

    init : str or array-like, optional
        Specify which type of population initialization is performed. Should be
        one of:

        - 'latinhypercube'
        - 'sobol'
        - 'halton'
        - 'random'
        - array specifying the initial population. The array should have