Conversation
redeboer
marked this pull request as ready for review
September 15, 2026 18:50
This branch has not been deployed
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.
Closes #524
🐛 Bug fixes
@unevaluatednow overridefuncwhenever they have fields declared withargument(sympify=False). Before, SymPy operations that rebuild an expression throughexpr.func(*expr.args)(replace,rewrite,doit,cse) silently reset these arguments to their defaults. ForEnergyDependentWidthwithphsp_factor=PhaseSpaceFactorSWave, for example,expr.replace(R, R2)evaluated to a different value thanexpr.funcreturns the class itself.funcreturns a subclass that fills in the instance's non-sympy values and constructs an instance of the original class. It compares equal to and hashes like the original class, so checks such asexpr.func == BreitWigner,expr.has(expr.func)andexpr.find(expr.func)keep working. Rebuilt instances have the original type, so pickling and cache hashes do not change.xreplacenow replaces a non-sympy attribute only if the rule has a key of the same type. PreviouslyFalsematched a key0orsympy.Integer(0), and mappings likeParameterValuesthat accept integer positions could replace such attributes by accident.❗ Behavioral changes
strandsreprprinters now render non-sympy arguments that differ from their defaults as keyword arguments, for instanceMyExpr(0, 3.14, functor=Transformation). This letsparse_exprreconstruct the original expression, given a namespace with the expression class and any classes used as attribute values. Custom printer methods and LaTeX output are unaffected.Squash commit messages