Skip to content

bounds cannot be used together with method=Brent in latest version of scipy (>= v1.10.1) #40

@thupchnsky

Description

@thupchnsky

SciPy (>= v1.10.1) will complain about this line

results = minimize_scalar(fun, method='Brent', bracket=(1, 2), bounds=[1, 100000])

because it now does not support using Brent when a bound is given (scipy source)

if bounds is not None and meth in {'brent', 'golden'}:
    message = f"Use of `bounds` is incompatible with 'method={method}'."
    raise ValueError(message)

Can switch to method='Bounded' to bypass this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions