#11334: Update numpy to 1.6.1
------------------------+---------------------------------------------------
Reporter: jason | Owner: tbd
Type: task | Status: new
Priority: major | Milestone: sage-4.8
Component: packages | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------+---------------------------------------------------
Comment(by jason):
It looks like it didn't automatically convert from RR to float, like it
should. That's what these two lines should do in sage/rings/real_mpfr.pyx
{{{
cdef object numpy_double_interface = {'typestr': '=f8'}
cdef object numpy_object_interface = {'typestr': '|O'}
}}}
and this property in that same file:
{{{
property __array_interface__:
def __get__(self):
"""
Used for NumPy conversion.
EXAMPLES::
sage: import numpy
sage: numpy.arange(10.0)
array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
sage: numpy.array([1.0, 1.1, 1.2]).dtype
dtype('float64')
sage:
numpy.array([1.000000000000000000000000000000000000]).dtype
dtype('object')
"""
if (<RealField_class>self._parent).__prec <= 57: # max size of
repr(float)
return numpy_double_interface
else:
return numpy_object_interface
}}}
So maybe numpy doesn't do something with `__array_interface__` anymore in
linspace?
Can you try `numpy.linspace(0.0,9.0,float(10))`,
`numpy.linspace(0.0,float(9),10)`, `numpy.linspace(float(0),9.0,10)` and
various other combinations of float vs. Sage types in the arguments to
narrow down what is triggering it?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11334#comment:29>
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.