Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r68467:12d7e32de888
Date: 2013-12-18 05:06 -0500
http://bitbucket.org/pypy/pypy/changeset/12d7e32de888/

Log:    ones lives at python-level in numpy now

diff --git a/pypy/module/micronumpy/__init__.py 
b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -10,7 +10,6 @@
         'array': 'interp_numarray.array',
         'zeros': 'interp_numarray.zeros',
         'empty': 'interp_numarray.zeros',
-        'ones': 'interp_numarray.ones',
         'empty_like': 'interp_numarray.empty_like',
         '_reconstruct' : 'interp_numarray._reconstruct',
         'scalar' : 'interp_numarray.build_scalar',
diff --git a/pypy/module/micronumpy/interp_numarray.py 
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -1447,15 +1447,6 @@
     shape = _find_shape(space, w_shape, dtype)
     return W_NDimArray.from_shape(space, shape, dtype=dtype, order=order)
 
-@unwrap_spec(order=str)
-def ones(space, w_shape, w_dtype=None, order='C'):
-    dtype = space.interp_w(interp_dtype.W_Dtype,
-        space.call_function(space.gettypefor(interp_dtype.W_Dtype), w_dtype))
-    shape = _find_shape(space, w_shape, dtype)
-    w_arr = W_NDimArray.from_shape(space, shape, dtype=dtype, order=order)
-    w_arr.fill(space, dtype.box(1))
-    return w_arr
-
 @unwrap_spec(subok=bool)
 def empty_like(space, w_a, w_dtype=None, w_order=None, subok=True):
     w_a = convert_to_array(space, w_a)
diff --git a/pypy/module/micronumpy/test/dummy_module.py 
b/pypy/module/micronumpy/test/dummy_module.py
--- a/pypy/module/micronumpy/test/dummy_module.py
+++ b/pypy/module/micronumpy/test/dummy_module.py
@@ -32,3 +32,8 @@
 
 True_ = bool_(True)
 False_ = bool_(False)
+
+def ones(*args, **kwargs):
+    a = zeros(*args, **kwargs)
+    a.fill(1)
+    return a
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to