Re: [sympy] Code Quality test failing on github even though local tests doesn't give any error

2024-02-18 Thread Oscar Benjamin
We should just remove slotscheck from CI. It isn't useful enough to justify any CI maintenance burden. -- Oscar On Tue, 13 Feb 2024 at 13:20, Shishir Kushwaha wrote: > > I have opened a PR which potentially fixes the issue , however the warnign > about the deprecated modules remain kindly

[sympy] How to avoid distributing a constant factor after differentiation?

2024-02-18 Thread Matthias Geier
Hi all. I have a simple expression: >>> import sympy as sp >>> a, b, t, t0 = sp.symbols('a b t t0') >>> expr = a*(t - t0)**3 + b*(t - t0)**2 And I would like to differentiate it with respect to t: >>> expr.diff(t) 3*a*(t - t0)**2 + b*(2*t - 2*t0) Why is the constant "2" distributed in the

[sympy] Re: How to avoid distributing a constant factor after differentiation?

2024-02-18 Thread Chris Smith
Autodistribution of Number into an Add is how SymPy works and there is no flag for differentiation (or for many functions) that would prevent it. Simply pass the expression to `factor_terms` to get it cleaned up. (But that will extract a factor of `t-t0`, too, which you might not want so you