Re: [sympy] Specifying term order

2013-01-21 Thread Sergiu Ivanov
On Sat, Jan 19, 2013 at 07:59:18PM +0300, David Ketcheson wrote: Thanks, Sergiu. I don't use isympy and I can't find any documentation of these options or how to use them directly with the print command. Do you know where any documentation is, or do you have an example using print? I am not

Re: [sympy] Specifying term order

2013-01-19 Thread David Ketcheson
Thanks, Sergiu. I don't use isympy and I can't find any documentation of these options or how to use them directly with the print command. Do you know where any documentation is, or do you have an example using print? Thanks, David On Wed, Jan 16, 2013 at 4:40 PM, Sergiu Ivanov

[sympy] Specifying term order

2013-01-16 Thread David Ketcheson
What options are available for specifying the order in which terms are printed? If I do sympy.diff(f,x) + sympy.diff(f,x,2) I get Derivative(f(x), x) + Derivative(f(x), x, x) but if I do sympy.diff(f,x) + h*sympy.diff(f,x,2) then the terms are reversed: h*Derivative(f(x), x, x) +

Re: [sympy] Specifying term order

2013-01-16 Thread Sergiu Ivanov
Hello, On Wed, Jan 16, 2013 at 04:09:07AM -0800, David Ketcheson wrote: What options are available for specifying the order in which terms are printed? If I do [...] I think I know what the logic here is, but I'd like to order terms by increasing order of derivative (or increasing

Re: [sympy] Specifying term order

2013-01-16 Thread Chris Smith
btw, trying to sort the args yourself doesn't work because the printers (unfortunately?) reorder them: eq h*Derivative(f(x), x, x) + Derivative(f(x), x) + Derivative(f(x), x, x) new = Add(*ordered(eq.args, lambda w: (sum(len(d.variables) if isinstance(d, Derivative) else 0 for d in