"Fossies" - the Fresh Open Source Software Archive

Source code changes of the file "numpy/lib/tests/test_arraysetops.py" betweennumpy-1.21.0.tar.gz and numpy-1.21.1.tar.gz

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

test_arraysetops.py  (numpy-1.21.0):test_arraysetops.py  (numpy-1.21.1)
skipping to change at line 611 skipping to change at line 611
a = [np.timedelta64(1, 'D'), nat, np.timedelta64(1, 'h'), nat] a = [np.timedelta64(1, 'D'), nat, np.timedelta64(1, 'h'), nat]
ua = [np.timedelta64(1, 'h'), np.timedelta64(1, 'D'), nat] ua = [np.timedelta64(1, 'h'), np.timedelta64(1, 'D'), nat]
ua_idx = [2, 0, 1] ua_idx = [2, 0, 1]
ua_inv = [1, 2, 0, 2] ua_inv = [1, 2, 0, 2]
ua_cnt = [1, 1, 2] ua_cnt = [1, 1, 2]
assert_equal(np.unique(a), ua) assert_equal(np.unique(a), ua)
assert_equal(np.unique(a, return_index=True), (ua, ua_idx)) assert_equal(np.unique(a, return_index=True), (ua, ua_idx))
assert_equal(np.unique(a, return_inverse=True), (ua, ua_inv)) assert_equal(np.unique(a, return_inverse=True), (ua, ua_inv))
assert_equal(np.unique(a, return_counts=True), (ua, ua_cnt)) assert_equal(np.unique(a, return_counts=True), (ua, ua_cnt))
# test for gh-19300
all_nans = [np.nan] * 4
ua = [np.nan]
ua_idx = [0]
ua_inv = [0, 0, 0, 0]
ua_cnt = [4]
assert_equal(np.unique(all_nans), ua)
assert_equal(np.unique(all_nans, return_index=True), (ua, ua_idx))
assert_equal(np.unique(all_nans, return_inverse=True), (ua, ua_inv))
assert_equal(np.unique(all_nans, return_counts=True), (ua, ua_cnt))
def test_unique_axis_errors(self): def test_unique_axis_errors(self):
assert_raises(TypeError, self._run_axis_tests, object) assert_raises(TypeError, self._run_axis_tests, object)
assert_raises(TypeError, self._run_axis_tests, assert_raises(TypeError, self._run_axis_tests,
[('a', int), ('b', object)]) [('a', int), ('b', object)])
assert_raises(np.AxisError, unique, np.arange(10), axis=2) assert_raises(np.AxisError, unique, np.arange(10), axis=2)
assert_raises(np.AxisError, unique, np.arange(10), axis=-2) assert_raises(np.AxisError, unique, np.arange(10), axis=-2)
def test_unique_axis_list(self): def test_unique_axis_list(self):
msg = "Unique failed on list of lists" msg = "Unique failed on list of lists"
End of changes. 1 change blocks.
0 lines changed or deleted 11 lines changed or added