Created
February 1, 2021 17:18
-
-
Save ogrisel/faa61675b490dcf749a60e26840938fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NumPy version 0.3.0+24607.gd075ba2ce | |
NumPy relaxed strides checking option: True | |
NumPy CPU features: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP? ASIMDDP? | |
........................................................................ [ 0%] | |
......................................................x................. [ 1%] | |
........................................................................ [ 1%] | |
................................................x....................... [ 2%] | |
........................................................................ [ 2%] | |
........................................................................ [ 3%] | |
........................................................................ [ 3%] | |
..................sss................................................... [ 4%] | |
..................................................................s..... [ 4%] | |
........................................................................ [ 5%] | |
........................x..........x..x..........x...................... [ 5%] | |
......................................................................s. [ 6%] | |
..........................................................ssssssss...... [ 6%] | |
........................................................................ [ 7%] | |
........................................................................ [ 8%] | |
......ssss................................x............................. [ 8%] | |
........................................................................ [ 9%] | |
........................................................................ [ 9%] | |
........................................................................ [ 10%] | |
........................................................................ [ 10%] | |
........................................................................ [ 11%] | |
........................................................................ [ 11%] | |
........................................................................ [ 12%] | |
........................................................................ [ 12%] | |
........................................................................ [ 13%] | |
........................................................................ [ 13%] | |
........................................................................ [ 14%] | |
........................................................................ [ 14%] | |
........................................................................ [ 15%] | |
..................................s..................................... [ 16%] | |
........................................................................ [ 16%] | |
........................................................xx.............. [ 17%] | |
........................................................................ [ 17%] | |
..........................................s............................. [ 18%] | |
........................................................................ [ 18%] | |
........................................................................ [ 19%] | |
........................................................................ [ 19%] | |
........................................................................ [ 20%] | |
........................................................................ [ 20%] | |
........................................................................ [ 21%] | |
........................................................................ [ 21%] | |
........................................................................ [ 22%] | |
........................................................................ [ 22%] | |
........................................................................ [ 23%] | |
........................................................................ [ 24%] | |
........................................................................ [ 24%] | |
........................................................................ [ 25%] | |
........................................................................ [ 25%] | |
........................................................................ [ 26%] | |
........................................................................ [ 26%] | |
........................................................................ [ 27%] | |
........................................................................ [ 27%] | |
...................x...x................................................ [ 28%] | |
........................................................................ [ 28%] | |
.............................................................xx......... [ 29%] | |
........................................................................ [ 29%] | |
........................................................................ [ 30%] | |
........................................................................ [ 30%] | |
........................................................................ [ 31%] | |
........................................................................ [ 32%] | |
........................................................................ [ 32%] | |
........................................................................ [ 33%] | |
........................................................................ [ 33%] | |
.............................................................s.......... [ 34%] | |
........................................................................ [ 34%] | |
........................................................................ [ 35%] | |
.........................s.............................................. [ 35%] | |
............................................................ss.......... [ 36%] | |
.............................................s.......................... [ 36%] | |
........................................................................ [ 37%] | |
........................................................................ [ 37%] | |
........................................................................ [ 38%] | |
........................................................................ [ 38%] | |
........................................................................ [ 39%] | |
..........................................................s............. [ 40%] | |
....................................................F................... [ 40%] | |
........................................................................ [ 41%] | |
........................................................................ [ 41%] | |
........................................................................ [ 42%] | |
........................................................................ [ 42%] | |
........................................................................ [ 43%] | |
......................................................ssssssssssss...... [ 43%] | |
........................................................................ [ 44%] | |
......................................................s...s............. [ 44%] | |
..s.ss.s..s.......s..................................................... [ 45%] | |
........................................................................ [ 45%] | |
........................................................................ [ 46%] | |
........................................................................ [ 46%] | |
........................................................................ [ 47%] | |
........................................................................ [ 48%] | |
........................................................................ [ 48%] | |
........................................................................ [ 49%] | |
........................................................................ [ 49%] | |
........................s...........sssssssssssssss...............ssssss [ 50%] | |
sssssssss............................................................... [ 50%] | |
........................................................................ [ 51%] | |
........................................................................ [ 51%] | |
........................................................................ [ 52%] | |
........................................F......FF....................... [ 52%] | |
........................................................................ [ 53%] | |
........................................ssss................ss.......... [ 53%] | |
........................................................................ [ 54%] | |
........................................................................ [ 55%] | |
.......................................................................x [ 55%] | |
........................................................................ [ 56%] | |
........................................................................ [ 56%] | |
........................................................................ [ 57%] | |
........................................................................ [ 57%] | |
........................................................................ [ 58%] | |
........................................................................ [ 58%] | |
........................................................................ [ 59%] | |
........................................................................ [ 59%] | |
........................................................................ [ 60%] | |
.......................................................x................ [ 60%] | |
........................................................................ [ 61%] | |
........................................................................ [ 61%] | |
........................................................................ [ 62%] | |
........................................................................ [ 63%] | |
........................................................................ [ 63%] | |
........................................................................ [ 64%] | |
........................................................................ [ 64%] | |
........................................................................ [ 65%] | |
........................................................................ [ 65%] | |
........................................................................ [ 66%] | |
........................................................................ [ 66%] | |
........................................................................ [ 67%] | |
.....................x.................................................. [ 67%] | |
........................................................................ [ 68%] | |
........................................................................ [ 68%] | |
.........................................s.............................. [ 69%] | |
........................................................................ [ 69%] | |
........................................................................ [ 70%] | |
........................................................................ [ 71%] | |
.............................s...................x...................... [ 71%] | |
........................................................................ [ 72%] | |
........................................................................ [ 72%] | |
........................................................................ [ 73%] | |
........................................................................ [ 73%] | |
........................................................................ [ 74%] | |
........................................................................ [ 74%] | |
........................................................................ [ 75%] | |
........................................................................ [ 75%] | |
........................................................................ [ 76%] | |
........................................................................ [ 76%] | |
........................................................................ [ 77%] | |
........................................................................ [ 77%] | |
........................................................................ [ 78%] | |
........................................................................ [ 79%] | |
........................................................................ [ 79%] | |
........................................................................ [ 80%] | |
........................................................................ [ 80%] | |
........................................................................ [ 81%] | |
.FF..................................................................... [ 81%] | |
..................................................xx.................... [ 82%] | |
........................................................................ [ 82%] | |
........................................................................ [ 83%] | |
........................................................................ [ 83%] | |
........................................................................ [ 84%] | |
........................................................................ [ 84%] | |
........................................................................ [ 85%] | |
........................................................................ [ 85%] | |
........................................................................ [ 86%] | |
........................................................................ [ 87%] | |
........................................................................ [ 87%] | |
........................................................................ [ 88%] | |
........................................................................ [ 88%] | |
........................................................................ [ 89%] | |
........................................................................ [ 89%] | |
........................................................................ [ 90%] | |
........................................s................s.............. [ 90%] | |
..s.................s....ss............................................. [ 91%] | |
........................................................................ [ 91%] | |
........................................................................ [ 92%] | |
........................................................................ [ 92%] | |
........................................................................ [ 93%] | |
........................................................................ [ 93%] | |
........................................................................ [ 94%] | |
........................................................................ [ 95%] | |
..................................s..................................... [ 95%] | |
........................................................................ [ 96%] | |
........................................................................ [ 96%] | |
........................................................................ [ 97%] | |
..........ss............................................................ [ 97%] | |
........................................................................ [ 98%] | |
........................................................................ [ 98%] | |
....................................................................sss. [ 99%] | |
........................................................................ [ 99%] | |
..............sss.. [100%] | |
=================================== FAILURES =================================== | |
_____ TestUfuncGenericLoops.test_unary_PyUFunc_O_O_method_full[reciprocal] _____ | |
self = <numpy.core.tests.test_ufunc.TestUfuncGenericLoops object at 0x13867c790> | |
ufunc = <ufunc 'reciprocal'> | |
@pytest.mark.parametrize("ufunc", UNARY_OBJECT_UFUNCS) | |
def test_unary_PyUFunc_O_O_method_full(self, ufunc): | |
"""Compare the result of the object loop with non-object one""" | |
val = np.float64(np.pi/4) | |
class MyFloat(np.float64): | |
def __getattr__(self, attr): | |
try: | |
return super().__getattr__(attr) | |
except AttributeError: | |
return lambda: getattr(np.core.umath, attr)(val) | |
num_arr = np.array([val], dtype=np.float64) | |
obj_arr = np.array([MyFloat(val)], dtype="O") | |
with np.errstate(all="raise"): | |
try: | |
> res_num = ufunc(num_arr) | |
E FloatingPointError: divide by zero encountered in reciprocal | |
MyFloat = <class 'numpy.core.tests.test_ufunc.TestUfuncGenericLoops.test_unary_PyUFunc_O_O_method_full.<locals>.MyFloat'> | |
num_arr = array([0.78539816]) | |
obj_arr = array([0.7853981633974483], dtype=object) | |
self = <numpy.core.tests.test_ufunc.TestUfuncGenericLoops object at 0x13867c790> | |
ufunc = <ufunc 'reciprocal'> | |
val = 0.7853981633974483 | |
code/numpy/numpy/core/tests/test_ufunc.py:172: FloatingPointError | |
During handling of the above exception, another exception occurred: | |
self = <numpy.core.tests.test_ufunc.TestUfuncGenericLoops object at 0x13867c790> | |
ufunc = <ufunc 'reciprocal'> | |
@pytest.mark.parametrize("ufunc", UNARY_OBJECT_UFUNCS) | |
def test_unary_PyUFunc_O_O_method_full(self, ufunc): | |
"""Compare the result of the object loop with non-object one""" | |
val = np.float64(np.pi/4) | |
class MyFloat(np.float64): | |
def __getattr__(self, attr): | |
try: | |
return super().__getattr__(attr) | |
except AttributeError: | |
return lambda: getattr(np.core.umath, attr)(val) | |
num_arr = np.array([val], dtype=np.float64) | |
obj_arr = np.array([MyFloat(val)], dtype="O") | |
with np.errstate(all="raise"): | |
try: | |
res_num = ufunc(num_arr) | |
except Exception as exc: | |
with assert_raises(type(exc)): | |
> ufunc(obj_arr) | |
MyFloat = <class 'numpy.core.tests.test_ufunc.TestUfuncGenericLoops.test_unary_PyUFunc_O_O_method_full.<locals>.MyFloat'> | |
num_arr = array([0.78539816]) | |
obj_arr = array([0.7853981633974483], dtype=object) | |
self = <numpy.core.tests.test_ufunc.TestUfuncGenericLoops object at 0x13867c790> | |
ufunc = <ufunc 'reciprocal'> | |
val = 0.7853981633974483 | |
code/numpy/numpy/core/tests/test_ufunc.py:175: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
miniforge3/envs/numpy-dev/lib/python3.9/unittest/case.py:226: in __exit__ | |
self._raiseFailure("{} not raised".format(exc_name)) | |
exc_name = 'FloatingPointError' | |
exc_type = None | |
exc_value = None | |
self = <unittest.case._AssertRaisesContext object at 0x13867c250> | |
tb = None | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <unittest.case._AssertRaisesContext object at 0x13867c250> | |
standardMsg = 'FloatingPointError not raised' | |
def _raiseFailure(self, standardMsg): | |
msg = self.test_case._formatMessage(self.msg, standardMsg) | |
> raise self.test_case.failureException(msg) | |
E AssertionError: FloatingPointError not raised | |
msg = 'FloatingPointError not raised' | |
self = <unittest.case._AssertRaisesContext object at 0x13867c250> | |
standardMsg = 'FloatingPointError not raised' | |
miniforge3/envs/numpy-dev/lib/python3.9/unittest/case.py:163: AssertionError | |
_____________ TestSharedMemory.test_in_from_2casttype[LONGDOUBLE] ______________ | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1d0340> | |
def test_in_from_2casttype(self): | |
for t in self.type.cast_types(): | |
obj = np.array(self.num2seq, dtype=t.dtype) | |
> a = self.array([len(self.num2seq)], intent.in_, obj) | |
a = <numpy.f2py.tests.test_array_from_pyobj.Array object at 0x14a1d0400> | |
obj = array([1, 2]) | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1d0340> | |
t = <numpy.f2py.tests.test_array_from_pyobj.Type object at 0x13b7e6670> | |
code/numpy/numpy/f2py/tests/test_array_from_pyobj.py:322: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
code/numpy/numpy/f2py/tests/test_array_from_pyobj.py:313: in <lambda> | |
Array(Type(request.param), dims, intent, obj) | |
dims = [2] | |
intent = Intent(['in']) | |
obj = array([1, 2]) | |
request = <SubRequest 'setup_type' for <Function test_in_from_2seq[LONGDOUBLE]>> | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1d0340> | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <numpy.f2py.tests.test_array_from_pyobj.Array object at 0x14a1d0670> | |
typ = <numpy.f2py.tests.test_array_from_pyobj.Type object at 0x13b7e67c0> | |
dims = [2], intent = Intent(['in']), obj = array([1, 2]) | |
def __init__(self, typ, dims, intent, obj): | |
self.type = typ | |
self.dims = dims | |
self.intent = intent | |
self.obj_copy = copy.deepcopy(obj) | |
self.obj = obj | |
# arr.dtypechar may be different from typ.dtypechar | |
self.arr = wrap.call(typ.type_num, dims, intent.flags, obj) | |
assert_(isinstance(self.arr, np.ndarray), repr(type(self.arr))) | |
self.arr_attr = wrap.array_attrs(self.arr) | |
if len(dims) > 1: | |
if self.intent.is_intent('c'): | |
assert_(intent.flags & wrap.F2PY_INTENT_C) | |
assert_(not self.arr.flags['FORTRAN'], | |
repr((self.arr.flags, getattr(obj, 'flags', None)))) | |
assert_(self.arr.flags['CONTIGUOUS']) | |
assert_(not self.arr_attr[6] & wrap.FORTRAN) | |
else: | |
assert_(not intent.flags & wrap.F2PY_INTENT_C) | |
assert_(self.arr.flags['FORTRAN']) | |
assert_(not self.arr.flags['CONTIGUOUS']) | |
assert_(self.arr_attr[6] & wrap.FORTRAN) | |
if obj is None: | |
self.pyarr = None | |
self.pyarr_attr = None | |
return | |
if intent.is_intent('cache'): | |
assert_(isinstance(obj, np.ndarray), repr(type(obj))) | |
self.pyarr = np.array(obj).reshape(*dims).copy() | |
else: | |
self.pyarr = np.array( | |
np.array(obj, dtype=typ.dtypechar).reshape(*dims), | |
order=self.intent.is_intent('c') and 'C' or 'F') | |
assert_(self.pyarr.dtype == typ, | |
repr((self.pyarr.dtype, typ))) | |
assert_(self.pyarr.flags['OWNDATA'], (obj, intent)) | |
self.pyarr_attr = wrap.array_attrs(self.pyarr) | |
if len(dims) > 1: | |
if self.intent.is_intent('c'): | |
assert_(not self.pyarr.flags['FORTRAN']) | |
assert_(self.pyarr.flags['CONTIGUOUS']) | |
assert_(not self.pyarr_attr[6] & wrap.FORTRAN) | |
else: | |
assert_(self.pyarr.flags['FORTRAN']) | |
assert_(not self.pyarr.flags['CONTIGUOUS']) | |
assert_(self.pyarr_attr[6] & wrap.FORTRAN) | |
assert_(self.arr_attr[1] == self.pyarr_attr[1]) # nd | |
assert_(self.arr_attr[2] == self.pyarr_attr[2]) # dimensions | |
if self.arr_attr[1] <= 1: | |
assert_(self.arr_attr[3] == self.pyarr_attr[3], | |
repr((self.arr_attr[3], self.pyarr_attr[3], | |
self.arr.tobytes(), self.pyarr.tobytes()))) # strides | |
assert_(self.arr_attr[5][-2:] == self.pyarr_attr[5][-2:], | |
repr((self.arr_attr[5], self.pyarr_attr[5]))) # descr | |
assert_(self.arr_attr[6] == self.pyarr_attr[6], | |
repr((self.arr_attr[6], self.pyarr_attr[6], | |
flags2names(0 * self.arr_attr[6] - self.pyarr_attr[6]), | |
flags2names(self.arr_attr[6]), intent))) # flags | |
if intent.is_intent('cache'): | |
assert_(self.arr_attr[5][3] >= self.type.elsize, | |
repr((self.arr_attr[5][3], self.type.elsize))) | |
else: | |
assert_(self.arr_attr[5][3] == self.type.elsize, | |
repr((self.arr_attr[5][3], self.type.elsize))) | |
assert_(self.arr_equal(self.pyarr, self.arr)) | |
if isinstance(self.obj, np.ndarray): | |
if typ.elsize == Type(obj.dtype).elsize: | |
if not intent.is_intent('copy') and self.arr_attr[1] <= 1: | |
> assert_(self.has_shared_memory()) | |
E AssertionError | |
dims = [2] | |
intent = Intent(['in']) | |
obj = array([1, 2]) | |
self = <numpy.f2py.tests.test_array_from_pyobj.Array object at 0x14a1d0670> | |
typ = <numpy.f2py.tests.test_array_from_pyobj.Type object at 0x13b7e67c0> | |
code/numpy/numpy/f2py/tests/test_array_from_pyobj.py:273: AssertionError | |
____________ TestSharedMemory.test_f_in_from_23casttype[LONGDOUBLE] ____________ | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1e65b0> | |
def test_f_in_from_23casttype(self): | |
for t in self.type.cast_types(): | |
obj = np.array(self.num23seq, dtype=t.dtype, order='F') | |
a = self.array([len(self.num23seq), len(self.num23seq[0])], | |
intent.in_, obj) | |
if t.elsize == self.type.elsize: | |
> assert_(a.has_shared_memory(), repr(t.dtype)) | |
E AssertionError: dtype('int64') | |
a = <numpy.f2py.tests.test_array_from_pyobj.Array object at 0x14a1e6dc0> | |
obj = array([[1, 2, 3], | |
[4, 5, 6]]) | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1e65b0> | |
t = <numpy.f2py.tests.test_array_from_pyobj.Type object at 0x13b7e6670> | |
code/numpy/numpy/f2py/tests/test_array_from_pyobj.py:391: AssertionError | |
____________ TestSharedMemory.test_c_in_from_23casttype[LONGDOUBLE] ____________ | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1ecd30> | |
def test_c_in_from_23casttype(self): | |
for t in self.type.cast_types(): | |
obj = np.array(self.num23seq, dtype=t.dtype) | |
a = self.array([len(self.num23seq), len(self.num23seq[0])], | |
intent.in_.c, obj) | |
if t.elsize == self.type.elsize: | |
> assert_(a.has_shared_memory(), repr(t.dtype)) | |
E AssertionError: dtype('int64') | |
a = <numpy.f2py.tests.test_array_from_pyobj.Array object at 0x14a1ec490> | |
obj = array([[1, 2, 3], | |
[4, 5, 6]]) | |
self = <numpy.f2py.tests.test_array_from_pyobj.TestSharedMemory object at 0x14a1ecd30> | |
t = <numpy.f2py.tests.test_array_from_pyobj.Type object at 0x13b7e6670> | |
code/numpy/numpy/f2py/tests/test_array_from_pyobj.py:401: AssertionError | |
__ TestMaskedArrayInPlaceArithmetics.test_inplace_floor_division_scalar_type ___ | |
self = <numpy.ma.tests.test_core.TestMaskedArrayInPlaceArithmetics object at 0x14f65a220> | |
def test_inplace_floor_division_scalar_type(self): | |
# Test of inplace division | |
for t in self.othertypes: | |
with warnings.catch_warnings(record=True) as w: | |
warnings.filterwarnings("always") | |
(x, y, xm) = (_.astype(t) for _ in self.uint8data) | |
x = arange(10, dtype=t) * t(2) | |
xm = arange(10, dtype=t) * t(2) | |
xm[2] = masked | |
x //= t(2) | |
xm //= t(2) | |
assert_equal(x, y) | |
assert_equal(xm, y) | |
> assert_equal(len(w), 0, "Failed on type=%s." % t) | |
self = <numpy.ma.tests.test_core.TestMaskedArrayInPlaceArithmetics object at 0x14f65a220> | |
t = <class 'numpy.complex64'> | |
w = [<warnings.WarningMessage object at 0x14f65a580>, <warnings.WarningMessage object at 0x14f65a5b0>, <warnings.WarningMessage object at 0x14f65a5e0>, <warnings.WarningMessage object at 0x14f65a610>] | |
x = masked_array(data=[0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j, 4.+0.j, 5.+0.j, 6.+0.j, | |
7.+0.j, 8.+0.j, 9.+0.j], | |
mask=False, | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
xm = masked_array(data=[0j, (1+0j), --, (3+0j), (4+0j), (5+0j), (6+0j), (7+0j), | |
(8+0j), (9+0j)], | |
...alse, False, False, False, | |
False, False], | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
y = masked_array(data=[0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j, 4.+0.j, 5.+0.j, 6.+0.j, | |
7.+0.j, 8.+0.j, 9.+0.j], | |
mask=False, | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
code/numpy/numpy/ma/tests/test_core.py:2848: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
actual = 4, desired = 0, err_msg = "Failed on type=<class 'numpy.complex64'>." | |
def assert_equal(actual, desired, err_msg=''): | |
""" | |
Asserts that two items are equal. | |
""" | |
# Case #1: dictionary ..... | |
if isinstance(desired, dict): | |
if not isinstance(actual, dict): | |
raise AssertionError(repr(type(actual))) | |
assert_equal(len(actual), len(desired), err_msg) | |
for k, i in desired.items(): | |
if k not in actual: | |
raise AssertionError(f"{k} not in {actual}") | |
assert_equal(actual[k], desired[k], f'key={k!r}\n{err_msg}') | |
return | |
# Case #2: lists ..... | |
if isinstance(desired, (list, tuple)) and isinstance(actual, (list, tuple)): | |
return _assert_equal_on_sequences(actual, desired, err_msg='') | |
if not (isinstance(actual, ndarray) or isinstance(desired, ndarray)): | |
msg = build_err_msg([actual, desired], err_msg,) | |
if not desired == actual: | |
> raise AssertionError(msg) | |
E AssertionError: | |
E Items are not equal: Failed on type=<class 'numpy.complex64'>. | |
E ACTUAL: 4 | |
E DESIRED: 0 | |
actual = 4 | |
desired = 0 | |
err_msg = "Failed on type=<class 'numpy.complex64'>." | |
msg = "\nItems are not equal: Failed on type=<class 'numpy.complex64'>.\n ACTUAL: 4\n DESIRED: 0" | |
code/numpy/numpy/ma/testutils.py:129: AssertionError | |
___ TestMaskedArrayInPlaceArithmetics.test_inplace_floor_division_array_type ___ | |
self = <numpy.ma.tests.test_core.TestMaskedArrayInPlaceArithmetics object at 0x14fa31a30> | |
def test_inplace_floor_division_array_type(self): | |
# Test of inplace division | |
for t in self.othertypes: | |
with warnings.catch_warnings(record=True) as w: | |
warnings.filterwarnings("always") | |
(x, y, xm) = (_.astype(t) for _ in self.uint8data) | |
m = xm.mask | |
a = arange(10, dtype=t) | |
a[-1] = masked | |
x //= a | |
xm //= a | |
assert_equal(x, y // a) | |
assert_equal(xm, y // a) | |
assert_equal( | |
xm.mask, | |
mask_or(mask_or(m, a.mask), (a == t(0))) | |
) | |
> assert_equal(len(w), 0, f'Failed on type={t}.') | |
a = masked_array(data=[0j, (1+0j), (2+0j), (3+0j), (4+0j), (5+0j), (6+0j), | |
(7+0j), (8+0j), --], | |
...alse, False, False, False, | |
False, True], | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
m = array([ True, False, True, False, False, False, False, False, False, | |
True]) | |
self = <numpy.ma.tests.test_core.TestMaskedArrayInPlaceArithmetics object at 0x14fa31a30> | |
t = <class 'numpy.complex64'> | |
w = [<warnings.WarningMessage object at 0x14fa31460>, <warnings.WarningMessage object at 0x14fa31520>, <warnings.WarningMessage object at 0x14fa314f0>, <warnings.WarningMessage object at 0x14fa31550>] | |
x = masked_array(data=[--, (1+0j), (1+0j), (1+0j), (1+0j), (1+0j), (1+0j), | |
(1+0j), (1+0j), --], | |
...alse, False, False, False, | |
False, True], | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
xm = masked_array(data=[--, (1+0j), --, (1+0j), (1+0j), (1+0j), (1+0j), (1+0j), | |
(1+0j), --], | |
...alse, False, False, False, | |
False, True], | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
y = masked_array(data=[0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j, 4.+0.j, 5.+0.j, 6.+0.j, | |
7.+0.j, 8.+0.j, 9.+0.j], | |
mask=False, | |
fill_value=(1e+20+0j), | |
dtype=complex64) | |
code/numpy/numpy/ma/tests/test_core.py:2868: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
actual = 4, desired = 0, err_msg = "Failed on type=<class 'numpy.complex64'>." | |
def assert_equal(actual, desired, err_msg=''): | |
""" | |
Asserts that two items are equal. | |
""" | |
# Case #1: dictionary ..... | |
if isinstance(desired, dict): | |
if not isinstance(actual, dict): | |
raise AssertionError(repr(type(actual))) | |
assert_equal(len(actual), len(desired), err_msg) | |
for k, i in desired.items(): | |
if k not in actual: | |
raise AssertionError(f"{k} not in {actual}") | |
assert_equal(actual[k], desired[k], f'key={k!r}\n{err_msg}') | |
return | |
# Case #2: lists ..... | |
if isinstance(desired, (list, tuple)) and isinstance(actual, (list, tuple)): | |
return _assert_equal_on_sequences(actual, desired, err_msg='') | |
if not (isinstance(actual, ndarray) or isinstance(desired, ndarray)): | |
msg = build_err_msg([actual, desired], err_msg,) | |
if not desired == actual: | |
> raise AssertionError(msg) | |
E AssertionError: | |
E Items are not equal: Failed on type=<class 'numpy.complex64'>. | |
E ACTUAL: 4 | |
E DESIRED: 0 | |
actual = 4 | |
desired = 0 | |
err_msg = "Failed on type=<class 'numpy.complex64'>." | |
msg = "\nItems are not equal: Failed on type=<class 'numpy.complex64'>.\n ACTUAL: 4\n DESIRED: 0" | |
code/numpy/numpy/ma/testutils.py:129: AssertionError | |
=============================== warnings summary =============================== | |
code/numpy/numpy/core/tests/test_regression.py::TestRegression::test_object_array_from_list | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_regression.py:507: FutureWarning: Promotion of numbers and bools to strings is deprecated. In the future, code such as `np.concatenate((['string'], [0]))` will raise an error, while `np.asarray(['string', 0])` will return an array with `dtype=object`. To avoid the warning while retaining a string result use `dtype='U'` (or 'S'). To get an array of Python objects use `dtype=object`. (Warning added in NumPy 1.21) | |
assert_(np.array([1, 'A', None]).shape == (3,)) | |
code/numpy/numpy/core/tests/test_regression.py::TestRegression::test_string_truncation | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_regression.py:2058: FutureWarning: Promotion of numbers and bools to strings is deprecated. In the future, code such as `np.concatenate((['string'], [0]))` will raise an error, while `np.asarray(['string', 0])` will return an array with `dtype=object`. To avoid the warning while retaining a string result use `dtype='U'` (or 'S'). To get an array of Python objects use `dtype=object`. (Warning added in NumPy 1.21) | |
b = np.array([val, tostr('xx')]) | |
code/numpy/numpy/core/tests/test_regression.py::TestRegression::test_string_truncation | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_regression.py:2060: FutureWarning: Promotion of numbers and bools to strings is deprecated. In the future, code such as `np.concatenate((['string'], [0]))` will raise an error, while `np.asarray(['string', 0])` will return an array with `dtype=object`. To avoid the warning while retaining a string result use `dtype='U'` (or 'S'). To get an array of Python objects use `dtype=object`. (Warning added in NumPy 1.21) | |
b = np.array([tostr('xx'), val]) | |
code/numpy/numpy/core/tests/test_regression.py::TestRegression::test_string_truncation | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_regression.py:2064: FutureWarning: Promotion of numbers and bools to strings is deprecated. In the future, code such as `np.concatenate((['string'], [0]))` will raise an error, while `np.asarray(['string', 0])` will return an array with `dtype=object`. To avoid the warning while retaining a string result use `dtype='U'` (or 'S'). To get an array of Python objects use `dtype=object`. (Warning added in NumPy 1.21) | |
b = np.array([val, tostr('xxxxxxxxxx')]) | |
code/numpy/numpy/core/tests/test_regression.py::TestRegression::test_string_truncation | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_regression.py:2066: FutureWarning: Promotion of numbers and bools to strings is deprecated. In the future, code such as `np.concatenate((['string'], [0]))` will raise an error, while `np.asarray(['string', 0])` will return an array with `dtype=object`. To avoid the warning while retaining a string result use `dtype='U'` (or 'S'). To get an array of Python objects use `dtype=object`. (Warning added in NumPy 1.21) | |
b = np.array([tostr('xxxxxxxxxx'), val]) | |
code/numpy/numpy/core/tests/test_scalarmath.py::TestBaseMath::test_blocked | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_scalarmath.py:88: RuntimeWarning: divide by zero encountered in reciprocal | |
assert_almost_equal(np.reciprocal(inp2), | |
code/numpy/numpy/core/tests/test_umath.py::TestDivision::test_floor_division_complex | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:347: RuntimeWarning: divide by zero encountered in floor_divide | |
y = np.floor_divide(x**2, x) | |
code/numpy/numpy/core/tests/test_umath.py::TestPower::test_power_float | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:619: RuntimeWarning: divide by zero encountered in reciprocal | |
assert_almost_equal(x**(-1), [1., 0.5, 1./3]) | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1067: RuntimeWarning: divide by zero encountered in reciprocal | |
y_true128 = myfunc(x_f128) | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1074: RuntimeWarning: divide by zero encountered in reciprocal | |
assert_array_max_ulp(myfunc(x_f64), np.float64(y_true128), | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1081: RuntimeWarning: divide by zero encountered in reciprocal | |
assert_equal(myfunc(x_f64[::jj]), y_true64[::jj]) | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1072: RuntimeWarning: divide by zero encountered in reciprocal | |
assert_array_max_ulp(myfunc(x_f32), np.float32(y_true128), | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1078: RuntimeWarning: divide by zero encountered in reciprocal | |
y_true32 = myfunc(x_f32) | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1079: RuntimeWarning: divide by zero encountered in reciprocal | |
y_true64 = myfunc(x_f64) | |
code/numpy/numpy/core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc | |
/Users/ogrisel/code/numpy/numpy/core/tests/test_umath.py:1082: RuntimeWarning: divide by zero encountered in reciprocal | |
assert_equal(myfunc(x_f32[::jj]), y_true32[::jj]) | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex64] | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex128] | |
/Users/ogrisel/code/numpy/numpy/linalg/linalg.py:2158: RuntimeWarning: divide by zero encountered in det | |
r = _umath_linalg.det(a, signature=signature) | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex64] | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex128] | |
/Users/ogrisel/code/numpy/numpy/linalg/linalg.py:2158: RuntimeWarning: invalid value encountered in det | |
r = _umath_linalg.det(a, signature=signature) | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex64] | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex128] | |
/Users/ogrisel/code/numpy/numpy/linalg/linalg.py:2098: RuntimeWarning: divide by zero encountered in slogdet | |
sign, logdet = _umath_linalg.slogdet(a, signature=signature) | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex64] | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestDet::test_types[complex128] | |
/Users/ogrisel/code/numpy/numpy/linalg/linalg.py:2098: RuntimeWarning: invalid value encountered in slogdet | |
sign, logdet = _umath_linalg.slogdet(a, signature=signature) | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestNormDouble::test_axis | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestNormSingle::test_axis | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestNormInt64::test_axis | |
/Users/ogrisel/code/numpy/numpy/linalg/linalg.py:2570: RuntimeWarning: divide by zero encountered in reciprocal | |
ret **= (1 / ord) | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestNormDouble::test_axis | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestNormSingle::test_axis | |
code/numpy/numpy/linalg/tests/test_linalg.py::TestNormInt64::test_axis | |
/Users/ogrisel/code/numpy/numpy/linalg/linalg.py:2568: RuntimeWarning: divide by zero encountered in reciprocal | |
absx **= ord | |
code/numpy/numpy/ma/tests/test_mrecords.py::TestMRecordsImport::test_fromarrays | |
/Users/ogrisel/code/numpy/numpy/ma/core.py:2825: FutureWarning: Promotion of numbers and bools to strings is deprecated. In the future, code such as `np.concatenate((['string'], [0]))` will raise an error, while `np.asarray(['string', 0])` will return an array with `dtype=object`. To avoid the warning while retaining a string result use `dtype='U'` (or 'S'). To get an array of Python objects use `dtype=object`. (Warning added in NumPy 1.21) | |
_data = np.array(data, dtype=dtype, copy=copy, | |
-- Docs: https://docs.pytest.org/en/stable/warnings.html | |
=========================== short test summary info ============================ | |
FAILED code/numpy/numpy/core/tests/test_ufunc.py::TestUfuncGenericLoops::test_unary_PyUFunc_O_O_method_full[reciprocal] | |
FAILED code/numpy/numpy/f2py/tests/test_array_from_pyobj.py::TestSharedMemory::test_in_from_2casttype[LONGDOUBLE] | |
FAILED code/numpy/numpy/f2py/tests/test_array_from_pyobj.py::TestSharedMemory::test_f_in_from_23casttype[LONGDOUBLE] | |
FAILED code/numpy/numpy/f2py/tests/test_array_from_pyobj.py::TestSharedMemory::test_c_in_from_23casttype[LONGDOUBLE] | |
FAILED code/numpy/numpy/ma/tests/test_core.py::TestMaskedArrayInPlaceArithmetics::test_inplace_floor_division_scalar_type | |
FAILED code/numpy/numpy/ma/tests/test_core.py::TestMaskedArrayInPlaceArithmetics::test_inplace_floor_division_array_type | |
6 failed, 13359 passed, 99 skipped, 1215 deselected, 19 xfailed, 30 warnings in 123.84s (0:02:03) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using a debugger, the warnings raised in
test_inplace_floor_division_array_type
are: