#4786: fix some bugs / typos in the solve function
----------------------+-----------------------------------------------------
Reporter: was | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-3.2.2
Component: calculus | Keywords:
----------------------+-----------------------------------------------------
{{{
Is this the right place for suggestions for the function "solve" ?
1) The docstring has a typo : "... solve an equation of system ..."
Should be an "or" here.
2) The section
" solution_dict = True -- return a list of dictionaries containing the
solutions. "
made me think that solution_dict defaults to True which is not the case.
Maybe this could be made more clear.
3) 'solution_dict = True' fails when only a single univariate equation
is given. The solution is then not a list of lists and the conversion to
dictionary fails:
sage: var('a')
a
sage: solve ([a^2-1],a,solution_dict=True)
-
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/tom/<ipython console> in <module>()
/usr/local/sage/local/lib/python2.5/site-
packages/sage/calculus/equations.pyc
in solve(f, *args, **kwds)
1436 sol_list = string_to_list_of_solutions(a)
1437 if 'solution_dict' in kwds and kwds['solution_dict']==True:
- -> 1438 sol_dict=[dict([[eq.left(),eq.right()] for eq in
solution]) for solution in sol_list]
1439 return sol_dict
1440 else:
AttributeError: 'SymbolicVariable' object has no attribute 'left'
Thanks for your great work.
Thomas
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4786>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---