diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/dtypemeta.c | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_dtype.py | 6 | ||||
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_nditer.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_numeric.py | 5 |
5 files changed, 8 insertions, 9 deletions
diff --git a/numpy/core/src/multiarray/dtypemeta.c b/numpy/core/src/multiarray/dtypemeta.c index 9a191b12d..577478d2a 100644 --- a/numpy/core/src/multiarray/dtypemeta.c +++ b/numpy/core/src/multiarray/dtypemeta.c @@ -454,7 +454,7 @@ void_common_instance(PyArray_Descr *descr1, PyArray_Descr *descr2) return NULL; } /* - * If it is the same dtype and the contained did not change, we might + * If it is the same dtype and the container did not change, we might * as well preserve identity and metadata. This could probably be * changed. */ diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py index e91aeeb3f..2c7f0826e 100644 --- a/numpy/core/tests/test_dtype.py +++ b/numpy/core/tests/test_dtype.py @@ -1157,7 +1157,7 @@ class TestDTypeMakeCanonical: def test_make_canonical_hypothesis(self, dtype): canonical = np.result_type(dtype) self.check_canonical(dtype, canonical) - # np.result_type with two arguments should always identical results: + # result_type with two arguments should always give identical results: two_arg_result = np.result_type(dtype, dtype) assert np.can_cast(two_arg_result, canonical, casting="no") @@ -1174,7 +1174,7 @@ class TestDTypeMakeCanonical: assert dtype_with_empty_space.itemsize == dtype.itemsize canonicalized = np.result_type(dtype_with_empty_space) self.check_canonical(dtype_with_empty_space, canonicalized) - # np.promote_types with two arguments should always identical results: + # promotion with two arguments should always give identical results: two_arg_result = np.promote_types( dtype_with_empty_space, dtype_with_empty_space) assert np.can_cast(two_arg_result, canonicalized, casting="no") @@ -1186,7 +1186,7 @@ class TestDTypeMakeCanonical: assert dtype_with_empty_space.itemsize == dtype_aligned.itemsize canonicalized = np.result_type(dtype_with_empty_space) self.check_canonical(dtype_with_empty_space, canonicalized) - # np.promote_types with two arguments should always identical results: + # promotion with two arguments should always give identical results: two_arg_result = np.promote_types( dtype_with_empty_space, dtype_with_empty_space) assert np.can_cast(two_arg_result, canonicalized, casting="no") diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 324e99981..cf071a640 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -1246,7 +1246,7 @@ class TestStructured: x == y def test_structured_comparisons_with_promotion(self): - # Check that structured arrays can be compared so long that their + # Check that structured arrays can be compared so long as their # dtypes promote fine: a = np.array([(5, 42), (10, 1)], dtype=[('a', '>i8'), ('b', '<f8')]) b = np.array([(5, 43), (10, 1)], dtype=[('a', '<i8'), ('b', '>f8')]) diff --git a/numpy/core/tests/test_nditer.py b/numpy/core/tests/test_nditer.py index 0c036861b..b43bc50e9 100644 --- a/numpy/core/tests/test_nditer.py +++ b/numpy/core/tests/test_nditer.py @@ -1993,7 +1993,7 @@ def test_iter_buffered_cast_structured_type_failure_with_cleanup(): # This test was initially designed to test an error at a different # place, but will now raise earlier to to the cast not being possible: # `assert np.can_cast(a.dtype, sdt2, casting="unsafe")` fails. - # Without a faulty DType, there is probably probably no reliable + # Without a faulty DType, there is probably no reliable # way to get the initial tested behaviour. simple_arr = np.array([1, 2], dtype="i,i") # requires clean up with pytest.raises(TypeError): diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py index fc5012e21..173927810 100644 --- a/numpy/core/tests/test_numeric.py +++ b/numpy/core/tests/test_numeric.py @@ -933,12 +933,11 @@ class TestTypes: assert_equal(promote_types('O', S+'30'), np.dtype('O')) @pytest.mark.parametrize(["dtype1", "dtype2"], - [[np.dtype("V6"), np.dtype("V10")], + [[np.dtype("V6"), np.dtype("V10")], # mismatch shape + # Mismatching names: [np.dtype([("name1", "i8")]), np.dtype([("name2", "i8")])], ]) def test_invalid_void_promotion(self, dtype1, dtype2): - # Mainly test structured void promotion, which currently allows - # byte-swapping, but nothing else: with pytest.raises(TypeError): np.promote_types(dtype1, dtype2) |