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

Add ability to pass options to SciPy minimizers #1060

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

lvarriano
Copy link
Contributor

The various SciPy minimizers have different options that can be adjusted to change and improve performance. Presently, the iminuit API does not allow passing options to these minimizers, which limits their usefulness for some minimization problems (specifically mine). I added a parameter to minuit.scipy() to allow passing options to scipy.optimize.minimize(). It keeps the existing default options that were being passed and allows for these defaults to be overwritten by the user.

src/iminuit/minuit.py Outdated Show resolved Hide resolved
src/iminuit/minuit.py Outdated Show resolved Hide resolved
src/iminuit/minuit.py Outdated Show resolved Hide resolved
src/iminuit/minuit.py Outdated Show resolved Hide resolved
src/iminuit/minuit.py Outdated Show resolved Hide resolved
with pytest.raises(ValueError):
m.scipy(options=[])


Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to also have a test cases that shows the benefit of setting options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will work on adding this; the other changes have been made.

@HDembinski
Copy link
Member

Thanks, I am happy to include this patch, after some refinement.

src/iminuit/minuit.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants