#11334: Update numpy to 1.6.1
----------------------------+-----------------------------------------------
Reporter: jason | Owner: tbd
Type: task | Status: new
Priority: major | Milestone: sage-5.0
Component: packages | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
----------------------------+-----------------------------------------------
Comment (by strogdon):
Replying to [comment:29 jason]:
> So maybe numpy doesn't do something with `__array_interface__`
anymore in linspace?
I've been tinkering here and this is exactly what is happening. I deleted
all the
{{{
property __array_interface__:
}}}
blocks that were added by [http://trac.sagemath.org/sage_trac/raw-
attachment/ticket/5081/5081-numpy-types.patch 5081-numpy-types.patch] and
[http://trac.sagemath.org/sage_trac/raw-attachment/ticket/6506/6506-numpy-
types.patch 6506-numpy-types.patch] with no apparent effect on what
numpy.linspace() returns with numpy-1.6.1 installed. Of course, the
deleted blocks do affect what numpy.arange() and numpy.array() return:
{{{
sage: numpy.arange(10.0)
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=object)
sage: numpy.array([1.0, 1.1, 1.2]).dtype
dtype('object')
}}}
Also the example failure
{{{
from scipy import stats
stats.uniform(0,15).ppf([0.5,0.7])
}}}
from ticket #5081 now again fails with numpy-1.6.x (s-o-g result):
{{{
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/storage/strogdon/gentoo/usr/local/portage/sage-on-gentoo/<ipython
console> in <module>()
/storage/strogdon/gentoo/usr/lib/python2.7/site-
packages/scipy/stats/distributions.pyc in ppf(self, q)
449
450 def ppf(self, q):
--> 451 return self.dist.ppf(q, *self.args, **self.kwds)
452
453 def isf(self, q):
/storage/strogdon/gentoo/usr/lib/python2.7/site-
packages/scipy/stats/distributions.pyc in ppf(self, q, *args, **kwds)
1514 goodargs = argsreduce(cond, *((q,)+args+(scale,loc)))
1515 scale, loc, goodargs = goodargs[-2], goodargs[-1],
goodargs[:-2]
-> 1516 place(output,cond,self._ppf(*goodargs)*scale + loc)
1517 if output.ndim == 0:
1518 return output[()]
/storage/strogdon/gentoo/usr/lib/python2.7/site-
packages/numpy/lib/function_base.pyc in place(arr, mask, vals)
1333
1334 """
-> 1335 return _insert(arr, mask, vals)
1336
1337 def _nanop(op, fill, a, axis=None):
TypeError: array cannot be safely cast to required type
}}}
Starting with numpy-1.6.0 scalar upcasting rules were changed
[http://docs.scipy.org/doc/numpy/reference/ufuncs.html] and I'm wondering
if this change is interfering with how sage/cython is handling the python
!__array_interface!__ extension, at least relative to numpy.linspace(),
and perhaps other numpy functions that are pure python.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11334#comment:33>
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.