Skip to content

fix voronoi plot#911

Draft
SarahRo wants to merge 4 commits intodevelopfrom
fix-voronoi-plot
Draft

fix voronoi plot#911
SarahRo wants to merge 4 commits intodevelopfrom
fix-voronoi-plot

Conversation

@SarahRo
Copy link
Contributor

@SarahRo SarahRo commented Mar 10, 2026

Description

The surface plot in energy_based_electrode_design.ipynb should be closer to the contour plot of the result.

Cause of the difference is that the cost is recomputed for plotting for the contour plot whereas the surface plot uses result.cost. result.cost is identical to logger.cost_convergence and hence, rather than storing the cost for the corresponding points result.x_model, it contains the best cost up to each point in the optimisation process. To fix this, result.cost now returns the same as logger.cost and result.cost_convergence replaces result.cost.

Fixes #910

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #).

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: $ pre-commit run or $ nox -s pre-commit (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctest
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.86%. Comparing base (4628a65) to head (ef3bdf7).
⚠️ Report is 41 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #911      +/-   ##
===========================================
+ Coverage    89.41%   92.86%   +3.44%     
===========================================
  Files           63       73      +10     
  Lines         4857     5678     +821     
===========================================
+ Hits          4343     5273     +930     
+ Misses         514      405     -109     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Bug]: Surface plot and contour plot do not agree in energy_based_electrode_design.ipynb

1 participant