[pypy-commit] pypy import-numpy: fix more tests, thanks alex
fijal
noreply at buildbot.pypy.org
Fri Jan 6 20:57:50 CET 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: import-numpy
Changeset: r51081:9b39d93ee949
Date: 2012-01-06 21:57 +0200
http://bitbucket.org/pypy/pypy/changeset/9b39d93ee949/
Log: fix more tests, thanks alex
diff --git a/pypy/module/micronumpy/app_numpy.py b/pypy/module/micronumpy/app_numpy.py
--- a/pypy/module/micronumpy/app_numpy.py
+++ b/pypy/module/micronumpy/app_numpy.py
@@ -1,6 +1,6 @@
import math
-import numpypy
+import _numpypy
inf = float("inf")
@@ -14,29 +14,29 @@
return mean(a)
def identity(n, dtype=None):
- a = numpypy.zeros((n,n), dtype=dtype)
+ a = _numpypy.zeros((n,n), dtype=dtype)
for i in range(n):
a[i][i] = 1
return a
def mean(a):
if not hasattr(a, "mean"):
- a = numpypy.array(a)
+ a = _numpypy.array(a)
return a.mean()
def sum(a):
if not hasattr(a, "sum"):
- a = numpypy.array(a)
+ a = _numpypy.array(a)
return a.sum()
def min(a):
if not hasattr(a, "min"):
- a = numpypy.array(a)
+ a = _numpypy.array(a)
return a.min()
def max(a):
if not hasattr(a, "max"):
- a = numpypy.array(a)
+ a = _numpypy.array(a)
return a.max()
def arange(start, stop=None, step=1, dtype=None):
@@ -47,9 +47,9 @@
stop = start
start = 0
if dtype is None:
- test = numpypy.array([start, stop, step, 0])
+ test = _numpypy.array([start, stop, step, 0])
dtype = test.dtype
- arr = numpypy.zeros(int(math.ceil((stop - start) / step)), dtype=dtype)
+ arr = _numpypy.zeros(int(math.ceil((stop - start) / step)), dtype=dtype)
i = start
for j in range(arr.size):
arr[j] = i
@@ -90,5 +90,5 @@
you should assign the new shape to the shape attribute of the array
'''
if not hasattr(a, 'reshape'):
- a = numpypy.array(a)
+ a = _numpypy.array(a)
return a.reshape(shape)
More information about the pypy-commit
mailing list