8000 Merge pull request #6146 from charris/disable-numpy-ufunc-for-1.10 · numpy/numpy@c9cd742 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit c9cd742

Browse files
committed
Merge pull request #6146 from charris/disable-numpy-ufunc-for-1.10
MAINT: Temporarily disable __numpy_ufunc__ for 1.10
2 parents a39d355 + 51a0ab5 commit c9cd742

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

numpy/core/src/private/ufunc_override.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ PyUFunc_CheckOverride(PyUFuncObject *ufunc, char *method,
195195
/* Pos of each override in args */
196196
int with_override_pos[NPY_MAXARGS];
197197

198+
/****************************************************************
199+
* Temporarily disable this functionality for the 1.10 release.
200+
* See gh-5844.
201+
****************************************************************/
202+
*result = NULL;
203+
return 0;
204+
/****************************************************************
205+
* Actual implementation follows:
206+
****************************************************************/
207+
198208
/*
199209
* Check inputs
200210
*/

numpy/core/tests/test_multiarray.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,9 @@ def test_dot(self):
19381938
assert_equal(c, np.dot(a, b))
19391939

19401940
def test_dot_override(self):
1941+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
1942+
return
1943+
19411944
class A(object):
19421945
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
19431946
return "A"
@@ -2261,6 +2264,9 @@ def test_ufunc_override_rop_precedence(self):
22612264
# Check that __rmul__ and other right-hand operations have
22622265
# precedence over __numpy_ufunc__
22632266

2267+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
2268+
return
2269+
22642270
ops = {
22652271
'__add__': ('__radd__', np.add, True),
22662272
'__sub__': ('__rsub__', np.subtract, True),
@@ -2376,6 +2382,9 @@ def __rop__(self, *other):
23762382
yield check, op_name, False
23772383

23782384
def test_ufunc_override_rop_simple(self):
2385+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
2386+
return
2387+
23792388
# Check parts of the binary op overriding behavior in an
23802389
# explicit test case that is easier to understand.
23812390
class SomeClass(object):
@@ -2480,6 +2489,9 @@ def __rsub__(self, other):
24802489
assert_(isinstance(res, SomeClass3))
24812490

24822491
def test_ufunc_override_normalize_signature(self):
2492+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
2493+
return
2494+
24832495
# gh-5674
24842496
class SomeClass(object):
24852497
def __numpy_ufunc__(self, ufunc, method, i, inputs, **kw):
@@ -4160,6 +4172,9 @@ def test_dot_scalar_and_matrix_of_objects(self):
41604172
assert_equal(np.dot(3, arr), desired)
41614173

41624174
def test_dot_override(self):
4175+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
4176+
return
4177+
41634178
class A(object):
41644179
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
41654180
return "A"
@@ -4439,6 +4454,8 @@ def test_matrix_matrix_values(self):
44394454
assert_equal(res, tgt12_21)
44404455

44414456
def test_numpy_ufunc_override(self):
4457+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
4458+
return
44424459

44434460
class A(np.ndarray):
44444461
def __new__(cls, *args, **kwargs):

numpy/core/tests/test_umath.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,8 @@ def __array__(self):
12001200
assert_equal(ncu.maximum(a, C()), 0)
12011201

12021202
def test_ufunc_override(self):
1203+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
1204+
return
12031205

12041206
class A(object):
12051207
def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
@@ -1225,6 +1227,8 @@ def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
12251227
assert_equal(res1[5], {})
12261228

12271229
def test_ufunc_override_mro(self):
1230+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
1231+
return
12281232

12291233
# Some multi arg functions for testing.
12301234
def tres_mul(a, b, c):
@@ -1316,6 +1320,8 @@ def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
13161320
assert_raises(TypeError, four_mul_ufunc, 1, c, c_sub, c)
13171321

13181322
def test_ufunc_override_methods(self):
1323+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
1324+
return
13191325

13201326
class A(object):
13211327
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
@@ -1420,6 +1426,8 @@ def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
14201426
assert_equal(res[4], (a, [4, 2], 'b0'))
14211427

14221428
def test_ufunc_override_out(self):
1429+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
1430+
return
14231431

14241432
class A(object):
14251433
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
@@ -1454,6 +1462,8 @@ def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
14541462
assert_equal(res7['out'][1], 'out1')
14551463

14561464
def test_ufunc_override_exception(self):
1465+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
1466+
return
14571467

14581468
class A(object):
14591469
def __numpy_ufunc__(self, *a, **kwargs):

0 commit comments

Comments
 (0)
0