"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "numpy/core/tests/test_numeric.py" between
numpy-1.21.0.tar.gz and numpy-1.21.1.tar.gz

About: NumPy is the fundamental package for scientific computing with Python.

test_numeric.py  (numpy-1.21.0):test_numeric.py  (numpy-1.21.1)
skipping to change at line 1711 skipping to change at line 1711
res = np.array_equiv(np.array([1, 2]), np.array([2])) res = np.array_equiv(np.array([1, 2]), np.array([2]))
assert_(not res) assert_(not res)
assert_(type(res) is bool) assert_(type(res) is bool)
res = np.array_equiv(np.array([1, 2]), np.array([[1], [2]])) res = np.array_equiv(np.array([1, 2]), np.array([[1], [2]]))
assert_(not res) assert_(not res)
assert_(type(res) is bool) assert_(type(res) is bool)
res = np.array_equiv(np.array([1, 2]), np.array([[1, 2, 3], [4, 5, 6], [ 7, 8, 9]])) res = np.array_equiv(np.array([1, 2]), np.array([[1, 2, 3], [4, 5, 6], [ 7, 8, 9]]))
assert_(not res) assert_(not res)
assert_(type(res) is bool) assert_(type(res) is bool)
@pytest.mark.parametrize("dtype", ["V0", "V3", "V10"])
def test_compare_unstructured_voids(self, dtype):
zeros = np.zeros(3, dtype=dtype)
assert_array_equal(zeros, zeros)
assert not (zeros != zeros).any()
if dtype == "V0":
# Can't test != of actually different data
return
nonzeros = np.array([b"1", b"2", b"3"], dtype=dtype)
assert not (zeros == nonzeros).any()
assert (zeros != nonzeros).all()
def assert_array_strict_equal(x, y): def assert_array_strict_equal(x, y):
assert_array_equal(x, y) assert_array_equal(x, y)
# Check flags, 32 bit arches typically don't provide 16 byte alignment # Check flags, 32 bit arches typically don't provide 16 byte alignment
if ((x.dtype.alignment <= 8 or if ((x.dtype.alignment <= 8 or
np.intp().dtype.itemsize != 4) and np.intp().dtype.itemsize != 4) and
sys.platform != 'win32'): sys.platform != 'win32'):
assert_(x.flags == y.flags) assert_(x.flags == y.flags)
else: else:
assert_(x.flags.owndata == y.flags.owndata) assert_(x.flags.owndata == y.flags.owndata)
assert_(x.flags.writeable == y.flags.writeable) assert_(x.flags.writeable == y.flags.writeable)
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)