Skip to content

Conversation

@cxzhong
Copy link
Contributor

@cxzhong cxzhong commented Nov 20, 2025

Added signal blocking and unblocking around Python function calls to prevent conflicts with signal handling in external libraries.
Also fix some compiler warnings.
Improve #40980 , Fix #30379

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Added signal blocking and unblocking around Python function calls to prevent conflicts with signal handling in external libraries.
@cxzhong cxzhong marked this pull request as ready for review November 20, 2025 09:49
@cxzhong
Copy link
Contributor Author

cxzhong commented Nov 20, 2025

sage: f = lambda x, y: float(gamma_inc(2, 11/5)) * float(sin(x*y)) * float(exp(-x-y))
sage: result = monte_carlo_integral(f, [0, 0], [10, 10], 10000000, algorithm='vegas')
^C---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
Cell In[4], line 1
----> 1 result = monte_carlo_integral(f, [Integer(0), Integer(0)], [Integer(10), Integer(10)], Integer(10000000), algorithm='vegas')

File sage/calculus/integration.pyx:724, in sage.calculus.integration.monte_carlo_integral()

KeyboardInterrupt: 

KeyboardInterrupt is normal, it deals with Ctrl+C by itself

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.

Surprising error in numerical integration

1 participant