Skip to content

[Bug]: Limit max iterations not working on SciPy optimisers #237

Closed
@BradyPlanden

Description

Python Version

3.11

Describe the bug

The SciPy solvers aren't passed optim.set_max_iterations() correctly at the moment, this is fixed in #224.

Steps to reproduce the behaviour

    @pytest.mark.unit
    def test_infeasible_solutions(self, cost):
        # Test infeasible solutions
        for optimiser in [pybop.SciPyMinimize, pybop.GradientDescent]:
            optim = pybop.Optimisation(
                cost=cost, optimiser=optimiser, allow_infeasible_solutions=False
            )
            optim.set_max_iterations(1)
            optim.run()
            assert optim._iterations == 1

stochastically returns values > 1

Relevant log output

No response

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions