Comment #72 on issue 1694 by nicolas.pourcelot: solve has many issues with fractions
http://code.google.com/p/sympy/issues/detail?id=1694

So I misunderstood you, since I thought you wanted me to include Mul and Pow handling into guess*().

For what I see, you refactored code into a new _solve_one_equation() function, but the remaining is more or less what I wrote, so I'm ok with that. ;)

A few details :
1) "    def _solve_one_equation(f, symbol, flags):"
I think we should keep syntax consistent with other existing functions, so I would write:
"**flags" instead of "flags".
(I suppose you use flags so that any change to flags in _solve_one_equation() are backported to solve(), but this is confusing ; see also my last comment)

2) "sols, strategy = _solve_one_equation(ni, symbol, flags)"
strategy is never used after, have you any plan to use it in the future ?
I see strategy as an implementation detail of _solve_one_equation(), so maybe _solve_one_equation() should return only solutions.

3) In checksol() doctring:

Use flag 'solution_already_simplified=True' if sol was already simplified
       before, so as to avoid redundant simplification.

'solution_already_simplified=True' should be replaced by 'simplified=True'

4) In solve():

        if flags.get('simplified', True):
            return map(simplify, result)
        else:
            return result

This should be in _solve_one_equation(), since in the following code, solutions are assumed to be already simplified if simplified=True flag is set.

        for ni in n.as_Mul():
            sols, strategy = _solve_one_equation(ni, symbol, flags)
            for s in sols:
if not checksol(d, symbol, s, simplified=flags.get('simplified', False)):
                    result.append(s)

And it also removes necessity of using "flags" (instead of "**flags") in "_solve_one_equation()".


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

Reply via email to