optimagic-dev / optimagic

optimagic is a Python package for numerical optimization. It is a unified interface to optimizers from SciPy, NlOpt and other packages. optimagic's minimize function works just like SciPy's, so you don't have to adjust your code. You simply get more optimizers for free. On top you get diagnostic tools, parallel numerical derivatives and more.
https://optimagic.readthedocs.io/
MIT License
270 stars 30 forks source link

Allow for AlgorithmType in estimation functions #535

Closed timmens closed 1 month ago

timmens commented 2 months ago

With this PR, we allow the user to pass Algorithm classes and instances as optimize_options for the estimation functions estimate_ml and estimate_msm.

[!NOTE] This fix is not ideal because if the user passes an incorrect type, the error is thrown in optimize.py, which may be unexpected to some users. However, because the estimation functions will undergo a big rewrite in the future, we have decided to tackle this problem then.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Files with missing lines Coverage Δ
src/estimagic/estimate_ml.py 82.47% <100.00%> (ø)
src/estimagic/estimate_msm.py 89.68% <100.00%> (ø)
src/optimagic/shared/check_option_dicts.py 64.70% <ø> (ø)

... and 1 file with indirect coverage changes

janosg commented 2 months ago

@timmens, I made some small changes that fixed CI in #534