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
266 stars 30 forks source link

Refactor/logging #519

Closed schroedk closed 2 months ago

schroedk commented 3 months ago

The proposed logging is described here.

This refactoring introduces the following abstractions:

The old class OptimizationLogReader redirects to SQLiteLogReader in a backward-compatible way.

review-notebook-app[bot] commented 3 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.16283% with 38 lines in your changes missing coverage. Please review.

Project coverage is 90.90%. Comparing base (354155d) to head (3d815fc). Report is 1 commits behind head on 0.5.0.

Files Patch % Lines
src/optimagic/logging/base.py 85.71% 11 Missing :warning:
src/optimagic/logging/logger.py 95.34% 10 Missing :warning:
src/optimagic/logging/sqlalchemy.py 95.56% 7 Missing :warning:
src/optimagic/typing.py 84.09% 7 Missing :warning:
src/optimagic/optimization/multistart.py 71.42% 2 Missing :warning:
...imagic/optimization/create_optimization_problem.py 90.90% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## 0.5.0 #519 +/- ## ========================================== + Coverage 90.71% 90.90% +0.18% ========================================== Files 106 107 +1 Lines 10364 10644 +280 ========================================== + Hits 9402 9676 +274 - Misses 962 968 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

schroedk commented 2 months ago

I am through now. Thanks a lot for this PR!

One thing that is left to do is adding a logger field to the OptimizeResult.

Done