Skip to content

Rework sympy to pymbolic mappers - #305

Draft
alexfikl wants to merge 2 commits into
inducer:mainfrom
alexfikl:refactor-sympy-mapper
Draft

Rework sympy to pymbolic mappers#305
alexfikl wants to merge 2 commits into
inducer:mainfrom
alexfikl:refactor-sympy-mapper

Conversation

@alexfikl

@alexfikl alexfikl commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

The mappers previously inherited from either the Sympy or SymEngine variants based on USE_SYMENGINE. This meant that you couldn't use them at all for the other one, e.g. if USE_SYMENGINE=True there was no way to convert sympy expressions.

This implements both variants (with some code duplication) and adds to_pymbolic and to_symbolic helper functions that do the actual dispatch based on USE_SYMENGINE.

@alexfikl
alexfikl marked this pull request as draft September 4, 2026 18:26
@alexfikl

alexfikl commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Hmm.. this needs a bit more work. It needs to make a distinction between USE_SYMENGINE and HAS_SYMENGINE..

@alexfikl
alexfikl force-pushed the refactor-sympy-mapper branch from be27a05 to 463be35 Compare September 4, 2026 18:35
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