Skip to content

Comments

Update SympyToPymbolic mapper annotations#249

Merged
inducer merged 4 commits intoinducer:mainfrom
alexfikl:type-fixes-20251019
Oct 20, 2025
Merged

Update SympyToPymbolic mapper annotations#249
inducer merged 4 commits intoinducer:mainfrom
alexfikl:type-fixes-20251019

Conversation

@alexfikl
Copy link
Collaborator

https://github.com/inducer/sumpy/actions/runs/18624857397

This fixes some of the new CI failures due to pymbolic adding more typing to the interop classes. It also adds a bunch more type annotations to sumpy.symbolic, but those are pretty iffy.

@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from cd92aea to b77e63c Compare October 19, 2025 16:41
@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from b77e63c to d55c239 Compare October 19, 2025 16:43
@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from d55c239 to 71eb537 Compare October 19, 2025 16:44
Comment on lines 271 to 290
def find_power_of(base, prod):
def find_power_of(base: sym.Basic, prod: sym.Basic) -> int | sym.Basic:
remdr = sym.Wild("remdr")
power = sym.Wild("power")

result = prod.match(remdr*base**power)
if result is None:
return 0

return result[power]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't seem used and it also doesn't work with symengine as far as I can tell?

Copy link
Owner

Choose a reason for hiding this comment

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

If it's unused across sumpy and pytential, kill it!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it doesn't seem to be used at anywhere. I also removed vector_xreplace below, which seems to have gone unused since 557ec67.

https://github.com/inducer/sumpy/compare/f8a5b0f6648f9e4d655c4e689ba9b46aafe7a463..4bb63c4306ca3ab72ff57c50818c32eb70a8852c

@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from 71eb537 to 0689efa Compare October 19, 2025 16:55
@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from 0689efa to 60464cf Compare October 19, 2025 17:05
@alexfikl alexfikl marked this pull request as ready for review October 19, 2025 17:31
@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from 60464cf to f8a5b0f Compare October 20, 2025 05:57
@alexfikl alexfikl changed the title feat(typing): update SympyToPymbolic mapper Update SympyToPymbolic mapper annotations Oct 20, 2025
@alexfikl alexfikl force-pushed the type-fixes-20251019 branch from f8a5b0f to 4bb63c4 Compare October 20, 2025 18:44
@inducer inducer enabled auto-merge (rebase) October 20, 2025 18:56
@inducer
Copy link
Owner

inducer commented Oct 20, 2025

Ty!

@inducer inducer merged commit 61a68e1 into inducer:main Oct 20, 2025
8 checks passed
@alexfikl alexfikl deleted the type-fixes-20251019 branch October 22, 2025 08:17
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