Skip to content

Fix crash for non-numeric Pyfunction.eval - #532

Merged
isuruf merged 3 commits into
symengine:mainfrom
alexfikl:evalf-symbolic-pyfunction
Nov 2, 2026
Merged

isuruf merged 3 commits into
symengine:mainfrom
alexfikl:evalf-symbolic-pyfunction

Conversation

@alexfikl

@alexfikl alexfikl commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

The added test case would outright segfault before. This essentially tries to convert to a number and raises NotImplementedError if the expression is symbolic. That NotImplementedError is then caught by symengine/symengine#2173 and the expression is returned as is (which, as far as I know, matches sympy's behavior).

Needs: symengine/symengine#2173
xref: inducer/sumpy#306
cc: @inducer

@alexfikl
alexfikl force-pushed the evalf-symbolic-pyfunction branch from 0b76eaa to 2cd76d3 Compare October 6, 2026 11:18
@alexfikl
alexfikl marked this pull request as ready for review October 25, 2026 15:02
@alexfikl

Copy link
Copy Markdown
Contributor Author

The CI is currently failing because the test added here fails without symengine/symengine#2173. What's the workflow for that? Do we wait for a new release of symengine and update symengine_verson.txt?

@isuruf

isuruf commented Oct 28, 2026

Copy link
Copy Markdown
Member

You can use a commit hash in symengine_version.txt

@alexfikl

Copy link
Copy Markdown
Contributor Author

You can use a commit hash in symengine_version.txt

Done! Fingers crossed 😁

@isuruf
isuruf merged commit 329cd44 into symengine:main Nov 2, 2026
20 checks passed
@alexfikl
alexfikl deleted the evalf-symbolic-pyfunction branch November 2, 2026 20:11
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.

2 participants