[pypy-commit] pypy numpy_partition: Added function for parition call from micronumpy
Sergey Matyunin
pypy.commits at gmail.com
Sat Mar 5 17:05:01 EST 2016
Author: Sergey Matyunin <sbmatyunin at gmail.com>
Branch: numpy_partition
Changeset: r82798:b0b79d1b0927
Date: 2016-02-29 22:06 +0100
http://bitbucket.org/pypy/pypy/changeset/b0b79d1b0927/
Log: Added function for parition call from micronumpy
diff --git a/pypy/module/micronumpy/appbridge.py b/pypy/module/micronumpy/appbridge.py
--- a/pypy/module/micronumpy/appbridge.py
+++ b/pypy/module/micronumpy/appbridge.py
@@ -9,6 +9,7 @@
w_array_repr = None
w_array_str = None
w__usefields = None
+ w_partition = None
def __init__(self, space):
pass
diff --git a/pypy/module/micronumpy/ndarray.py b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -911,6 +911,10 @@
return
return self.implementation.sort(space, w_axis, w_order)
+ def descr_partition(self, space, __args__):
+ return get_appbridge_cache(space).call_method(
+ space, 'numpy.core._partition_use', 'partition', __args__.prepend(self))
+
def descr_squeeze(self, space, w_axis=None):
cur_shape = self.get_shape()
if not space.is_none(w_axis):
@@ -1635,6 +1639,7 @@
argsort = interp2app(W_NDimArray.descr_argsort),
sort = interp2app(W_NDimArray.descr_sort),
+ partition = interp2app(W_NDimArray.descr_partition),
astype = interp2app(W_NDimArray.descr_astype),
base = GetSetProperty(W_NDimArray.descr_get_base),
byteswap = interp2app(W_NDimArray.descr_byteswap),
More information about the pypy-commit
mailing list