Refactor is_linear_expression() in expr/expr.py#187
Merged
Conversation
yguclu
requested changes
Jul 14, 2026
yguclu
left a comment
Member
There was a problem hiding this comment.
Can you please update the library version to 0.19.3 in the file sympde/pyproject.toml?
added 3 commits
July 14, 2026 17:06
yguclu
requested changes
Jul 14, 2026
yguclu
left a comment
Member
There was a problem hiding this comment.
Good job @alisa-kirkinskaia! I have a couple of minor comments, mostly about formatting.
Member
Thanks for commit 85fba96! |
Co-authored-by: Yaman Güçlü <yaman.guclu@gmail.com>
yguclu
requested changes
Jul 17, 2026
Co-authored-by: Yaman Güçlü <yaman.guclu@gmail.com>
is_linear_expression() in expr/expr.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Fix #121:
Fix a bug in
is_linear_expressionrelated toexpand()being very slow for some expressions. The bug is caused by the following line:In the fix we avoid comparing the values of
a.expand()andb.expand()if(a-b).expand()is 0, as it already means the expression is linear.2. Refactor
is_linear_expressionfor better readability:integral3. Update library patch version to 0.19.3