Skip to content

Support walltime limit in ScipyOptimizer#1671

Merged
dweindl merged 1 commit intoICB-DCM:developfrom
dweindl:scipy_maxtime
Jan 20, 2026
Merged

Support walltime limit in ScipyOptimizer#1671
dweindl merged 1 commit intoICB-DCM:developfrom
dweindl:scipy_maxtime

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Jan 16, 2026

SciPy optimizers don't support wall time limits directly. However, this can be achieved through callbacks. This is done here.

@dweindl dweindl self-assigned this Jan 16, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.31%. Comparing base (b1bf44c) to head (07a89a3).

Files with missing lines Patch % Lines
pypesto/optimize/optimizer.py 92.85% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1671      +/-   ##
===========================================
- Coverage    84.34%   84.31%   -0.03%     
===========================================
  Files          164      164              
  Lines        14320    14334      +14     
===========================================
+ Hits         12078    12086       +8     
- Misses        2242     2248       +6     

☔ 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.

@dweindl dweindl changed the base branch from main to develop January 16, 2026 21:52
@dweindl dweindl marked this pull request as ready for review January 16, 2026 22:07
SciPy optimizers don't support wall time limits directly.
However, this can be achieved through callbacks. This is done here.
Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats an amazing workaround, never thought about it 🙈 thanks 🙏🏼

def fun(x):
import time

time.sleep(0.1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 0.1 enough? I would have thought 1.0 is necessary, similar to set_maxtime?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's less than the wall time limit to at least allow for some function evaluations. In my tests, it's still sufficiently long to not converge within the wall time limit.

@dweindl dweindl added this pull request to the merge queue Jan 20, 2026
Merged via the queue into ICB-DCM:develop with commit 5b32c08 Jan 20, 2026
18 checks passed
@dweindl dweindl deleted the scipy_maxtime branch January 20, 2026 12:31
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.

3 participants