Skip to content

Implementation of matplotlib backend for criterion_plot() #599

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

r3kste
Copy link
Contributor

@r3kste r3kste commented May 19, 2025

Summary of Changes

  1. Added backend parameter to criterion_plot() which accepts "plotly" or "matplotlib"
  2. criterion_plot() now returns the figure object corresponding to the chosen backend.
  3. Added backends.py which serves as a registry for all backends

To-Do

It is very much still a work in progress.

  • Discuss on whether the dispatch mechanism can be improved.
  • Add examples in documentation
  • Add suitable tests

Plot

Plotly Matplotlib
t t

Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 84.31373% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/optimagic/visualization/backends.py 78.87% 15 Missing ⚠️
src/optimagic/visualization/plotting_utilities.py 93.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/optimagic/config.py 70.27% <100.00%> (+0.82%) ⬆️
src/optimagic/visualization/history_plots.py 92.51% <100.00%> (+1.66%) ⬆️
src/optimagic/visualization/plotting_utilities.py 94.11% <93.33%> (-0.15%) ⬇️
src/optimagic/visualization/backends.py 78.87% <78.87%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@r3kste r3kste force-pushed the backend_plotting branch from 3efa340 to f780bf9 Compare May 19, 2025 19:11
@r3kste r3kste changed the title Barebones implementation of matplotlib backend for criterion_plot() Implementation of matplotlib backend for criterion_plot() May 20, 2025
@r3kste r3kste force-pushed the backend_plotting branch 3 times, most recently from df7f712 to 556334a Compare May 22, 2025 17:29
@r3kste r3kste force-pushed the backend_plotting branch from 556334a to d0c6856 Compare May 25, 2025 18:35
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.

1 participant