Am 09.09.2012 01:43, schrieb David Li:
Okay, so I've worked a bit on implicit multiplication and implicit function
application for sympify. A demo of SymPy Gamma with the changes is at
http://sympy-gamma-li.appspot.com/ (+ a visual overhaul, update to Python
2.7 runtime, new Django version). Expressions like 
'2x<http://sympy-gamma-li.appspot.com/input/?i=2x>',
'ln x <http://sympy-gamma-li.appspot.com/input/?i=ln+x>', and 
'5exp(x^2)<http://sympy-gamma-li.appspot.com/input/?i=5exp%28x%5E2%29>'
should work now.

The SymPy branch is at
https://github.com/lidavidm/sympy/tree/sympify_implicit_mul_and_apply. I am
still working on making sure the implicit application doesn't apply to
None, True, False, and other constants, making sure I haven't broken
anything/missed an edge case, and cleaning up the code.

I looked at the code, and found I had no idea what patterns are being recognized, and what parts of the recognized structures are transformed to what new structures. Sure, I could trace the single statements and find out what each function does, but it's really hard to get a bird's-eye view to work from, you need to build understanding from the details.

So I'd recommend documenting
- the patterns
- the transformations
Alternatively, I'd find it desirable to write the code in a form that directly expresses the patterns and transformations. This may be far outside the scope of this work though, so YMMV. Still, on my personal priority list, having explicit mention of patterns and transformations would be ahead of adding new transformations, just so that more people can follow what's happening and give feedback.

Just my 3c :-)

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

Reply via email to