#11885: call function in sage.libs.mpmath.utils doesn't handle 
parent=parent(float)
------------------------------+---------------------------------------------
   Reporter:  benjaminfjones  |          Owner:  burcin                      
       Type:  defect          |         Status:  needs_review                
   Priority:  major           |      Milestone:  sage-4.7.2                  
  Component:  symbolics       |       Keywords:  mpmath call parent precision
Work_issues:                  |       Upstream:  N/A                         
   Reviewer:                  |         Author:  Benjamin Jones              
     Merged:                  |   Dependencies:                              
------------------------------+---------------------------------------------
Changes (by newvalueoldvalue):

  * keywords:  mpmath call parent => mpmath call parent precision
  * status:  new => needs_review
  * author:  => Benjamin Jones


Old description:

> In multiple places in the Sage library the function
> `sage.libs.mpmath.utils.call` is called and inputs are passed along with
> their parents. If the parent of the input doesn't have a `prec` method,
> an AttributeError is raised:
>
> {{{
> sage: import sage.libs.mpmath.all as a
> sage: z = float(4)
> sage: a.call(a.e1, z)
> 0.00377935240984891
> sage: a.call(a.e1, z, parent=parent(z))
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call
> last)
>
> /Users/jonesbe/sage/sage-4.7.2.alpha2/devel/sage-test/sage/<ipython
> console> in <module>()
>
> /Users/jonesbe/sage/latest/local/lib/python2.6/site-
> packages/sage/libs/mpmath/utils.so in sage.libs.mpmath.utils.call
> (sage/libs/mpmath/utils.c:5277)()
>
> AttributeError: type object 'float' has no attribute 'prec'
> }}}
>
> This can be fixed with a simple check in in the `call` code in
> `sage/libs/mpmath/utils.pyx`.

New description:

 In multiple places in the Sage library the function
 `sage.libs.mpmath.utils.call` is called and inputs are passed along with
 their parents. If the parent of the input doesn't have a `prec` method, an
 `AttributeError` is raised:

 {{{
 sage: import sage.libs.mpmath.all as a
 sage: z = float(4)
 sage: a.call(a.e1, z)
 0.00377935240984891
 sage: a.call(a.e1, z, parent=parent(z))
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)

 /Users/jonesbe/sage/sage-4.7.2.alpha2/devel/sage-test/sage/<ipython
 console> in <module>()

 /Users/jonesbe/sage/latest/local/lib/python2.6/site-
 packages/sage/libs/mpmath/utils.so in sage.libs.mpmath.utils.call
 (sage/libs/mpmath/utils.c:5277)()

 AttributeError: type object 'float' has no attribute 'prec'
 }}}

 This can be fixed with a simple check in in the `call` code in
 `sage/libs/mpmath/utils.pyx`.

 ----

 Apply [attachment:trac_11885.patch] to the Sage library.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11885#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
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.

Reply via email to