Skip to content

Ensure exploration_results is a numpy array #607

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 1 commit into
base: main
Choose a base branch
from

Conversation

r3kste
Copy link
Contributor

@r3kste r3kste commented Jul 3, 2025

This PR ensures that exploration_results in MultistartInfo is always a numpy array.

Summary

  1. Fix a case where exploration_results is converted to a list.
  2. Test that it is a numpy array of dtype np.float64.
  3. Change type hint of exploration_results from list[float] to NDArray[np.float64].

Possible Changes

I would like to get feedback on whether the following changes should be included.

  • Use a less strict check for dtype of exploration_results. For example, a subdtype of np.floating
  • Add a check to assert that exploration_results is positive for minimize and negative for maximize.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/optimagic/optimization/optimize_result.py 94.16% <100.00%> (+0.04%) ⬆️
src/optimagic/optimization/process_results.py 94.11% <100.00%> (ø)
🚀 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.

1 participant