8000 MAINT: Temporarily disable __numpy_ufunc__ for 1.10 · numpy/numpy@e2dd12a · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e2dd12a

Browse files
committed
MAINT: Temporarily disable __numpy_ufunc__ for 1.10
Following discussion in gh-5844, we regretfully decided that we have to disable __numpy_ufunc__ again for 1.10. This patch should be reverted on master after 1.10 is branched.
1 parent 0c97cde commit e2dd12a

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-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
@@ -1923,6 +1923,9 @@ def test_dot(self):
19231923
assert_equal(c, np.dot(a, b))
19241924

19251925
def test_dot_override(self):
1926+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
1927+
return
1928+
19261929
class A(object):
19271930
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
19281931
return "A"
@@ -2246,6 +2249,9 @@ def test_ufunc_override_rop_precedence(self):
22462249
# Check that __rmul__ and other right-hand operations have
22472250
# precedence over __numpy_ufunc__
22482251

2252+
8000 # Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
2253+
return
2254+
22492255
ops = {
22502256
'__add__': ('__radd__', np.add, True),
22512257
'__sub__': ('__rsub__', np.subtract, True),
@@ -2361,6 +2367,9 @@ def __rop__(self, *other):
23612367
yield check, op_name, False
23622368

23632369
def test_ufunc_override_rop_simple(self):
2370+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
2371+
return
2372+
23642373
# Check parts of the binary op overriding behavior in an
23652374
# explicit test case that is easier to understand.
23662375
class SomeClass(object):
@@ -2460,6 +2469,9 @@ def __rsub__(self, other):
24602469
assert_(isinstance(res, SomeClass3))
24612470

24622471
def test_ufunc_override_normalize_signature(self):
2472+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
2473+
return
2474+
24632475
# gh-5674
24642476
class SomeClass(object):
24652477
def __numpy_ufunc__(self, ufunc, method, i, inputs, **kw):
@@ -3998,6 +4010,9 @@ def test_dot_scalar_and_matrix_of_objects(self):
39984010
assert_equal(np.dot(3, arr), desired)
39994011

40004012
def test_dot_override(self):
4013+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
4014+
return
4015+
40014016
class A(object):
40024017
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
40034018
return "A"
@@ -4279,6 +4294,8 @@ def test_matrix_matrix_values(self):
42794294
assert_equal(res, tgt12_21)
42804295

42814296
def test_numpy_ufunc_override(self):
4297+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
4298+
return
42824299

42834300
class A(np.ndarray):
42844301
def __new__(cls, *args, **kwargs):

numpy/core/tests/test_umath.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,9 @@ def __array__(self):
11621162
assert_equal(ncu.maximum(a, C()), 0)
11631163

11641164
def test_ufunc_override(self):
1165+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
1166+
return
1167+
11651168
class A(object):
11661169
def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
11671170
return self, func, method, pos, inputs, kwargs
@@ -1188,6 +1191,8 @@ def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
11881191
assert_equal(res1[5], {})
11891192

11901193
def test_ufunc_override_mro(self):
1194+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
1195+
return
11911196

11921197
# Some multi arg functions for testing.
11931198
def tres_mul(a, b, c):
@@ -1281,6 +1286,9 @@ def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
12811286
assert_raises(TypeError, four_mul_ufunc, 1, c, c_sub, c)
12821287

12831288
def test_ufunc_override_methods(self):
1289+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
1290+
return
1291+
12841292
class A(object):
12851293
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
12861294
return self, ufunc, method, pos, inputs, kwargs
@@ -1384,6 +1392,9 @@ def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
13841392
assert_equal(res[4], (a, [4, 2], 'b0'))
13851393

13861394
def test_ufunc_override_out(self):
1395+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5844
1396+
return
1397+
13871398
class A(object):
13881399
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
13891400
return kwargs
@@ -1418,6 +1429,9 @@ def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
14181429
assert_equal(res7['out'][1], 'out1')
14191430

14201431
def test_ufunc_override_exception(self):
1432+
# Temporarily disable __numpy_ufunc__ for 1.10; see gh-5864
1433+
return
1434+
14211435
class A(object):
14221436
def __numpy_ufunc__(self, *a, **kwargs):
14231437
raise ValueError("oops")

0 commit comments

Comments
 (0)
0