Comment #21 on issue 1923 by smichr: count_ops doesn't return a count (by default)
http://code.google.com/p/sympy/issues/detail?id=1923

I'd be happy to put the pieces together under branch 1694. Having looked back at comment 11 (after seeing your other work) I now understand what you were suggesting and how you were suggesting doing it. That's clever. We'll see what others think. If someone doesn't want the other ops they can just substitute all symbols (other than ADD, MUL and POW) with 1 to get the same result:

eq=(x+y+z); at=eq.atoms(Symbol); keep = set([x]); nil = at.difference(keep)
eq.subs(zip(nil, [1]*len(nil)))
2 + x

It's a long "one liner"...perhaps a keyword "primary_ops" could be used when visual is True to give just the ADD, MUL, POW (or vice version with a flag 'verbose' to give what you propose in comment 11).

I've been able to apply your patches without problem, so if you post one I can make the branch if you would like.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to