diff --git a/doc/neps/nep-0021-advanced-indexing.rst b/doc/neps/nep-0021-advanced-indexing.rst index 311ec7dc0cc4..badd41875af2 100644 --- a/doc/neps/nep-0021-advanced-indexing.rst +++ b/doc/neps/nep-0021-advanced-indexing.rst @@ -219,7 +219,7 @@ be deduced: no transposing should be done. The axes created by the integer array indices are always inserted at the front, even for a single index. -4. Boolean indexing is conceptionally outer indexing. Broadcasting +4. Boolean indexing is conceptually outer indexing. Broadcasting together with other advanced indices in the manner of legacy indexing is generally not helpful or well defined. A user who wishes the "``nonzero``" plus broadcast behaviour can thus diff --git a/doc/release/upcoming_changes/28254.expired.rst b/doc/release/upcoming_changes/28254.expired.rst index 54d82303a506..5f391eb6cbe2 100644 --- a/doc/release/upcoming_changes/28254.expired.rst +++ b/doc/release/upcoming_changes/28254.expired.rst @@ -3,7 +3,7 @@ * Remove alias ``generate_divbyzero_error`` to ``npy_set_floatstatus_divbyzero`` and ``generate_overflow_error`` to ``npy_set_floatstatus_overflow`` (deprecated since 1.10) * Remove ``np.tostring`` (deprecated since 1.19) * Raise on ``np.conjugate`` of non-numeric types (deprecated since 1.13) -* Raise when using ``np.bincount(...minlength=None)``, use 0 intead (deprecated since 1.14) +* Raise when using ``np.bincount(...minlength=None)``, use 0 instead (deprecated since 1.14) * Passing ``shape=None`` to functions with a non-optional shape argument errors, use ``()`` instead (deprecated since 1.20) * Inexact matches for ``mode`` and ``searchside`` raise (deprecated since 1.20) * Setting ``__array_finalize__ = None`` errors (deprecated since 1.23) diff --git a/doc/release/upcoming_changes/28569.change.rst b/doc/release/upcoming_changes/28569.change.rst new file mode 100644 index 000000000000..f9d26fda0484 --- /dev/null +++ b/doc/release/upcoming_changes/28569.change.rst @@ -0,0 +1,2 @@ +* A spelling error in the error message returned when converting a string to a float with the + method ``np.format_float_positional`` has been fixed. diff --git a/numpy/_core/src/multiarray/dragon4.c b/numpy/_core/src/multiarray/dragon4.c index b936f4dc213e..8783ec71e4af 100644 --- a/numpy/_core/src/multiarray/dragon4.c +++ b/numpy/_core/src/multiarray/dragon4.c @@ -1665,7 +1665,7 @@ FormatPositional(char *buffer, npy_uint32 bufferSize, BigInt *mantissa, pos += numDigits; if (count > maxPrintLen - pos) { - PyErr_SetString(PyExc_RuntimeError, "Float formating result too large"); + PyErr_SetString(PyExc_RuntimeError, "Float formatting result too large"); return -1; } @@ -1772,7 +1772,7 @@ FormatPositional(char *buffer, npy_uint32 bufferSize, BigInt *mantissa, npy_int32 count = desiredFractionalDigits - numFractionDigits; if (count > maxPrintLen - pos) { - PyErr_SetString(PyExc_RuntimeError, "Float formating result too large"); + PyErr_SetString(PyExc_RuntimeError, "Float formatting result too large"); return -1; } numFractionDigits += count; @@ -1816,7 +1816,7 @@ FormatPositional(char *buffer, npy_uint32 bufferSize, BigInt *mantissa, } if (count > maxPrintLen - pos) { - PyErr_SetString(PyExc_RuntimeError, "Float formating result too large"); + PyErr_SetString(PyExc_RuntimeError, "Float formatting result too large"); return -1; } @@ -1830,7 +1830,7 @@ FormatPositional(char *buffer, npy_uint32 bufferSize, BigInt *mantissa, npy_int32 count = pos; if (count > maxPrintLen - shift) { - PyErr_SetString(PyExc_RuntimeError, "Float formating result too large"); + PyErr_SetString(PyExc_RuntimeError, "Float formatting result too large"); return -1; } diff --git a/numpy/_core/tests/test_scalarprint.py b/numpy/_core/tests/test_scalarprint.py index 30073256d5bb..d9e35ab90ce1 100644 --- a/numpy/_core/tests/test_scalarprint.py +++ b/numpy/_core/tests/test_scalarprint.py @@ -277,15 +277,15 @@ def test_dragon4_positional_interface_overflow(self, tp, pad_val): #gh-28068 with pytest.raises(RuntimeError, - match="Float formating result too large"): + match="Float formatting result too large"): fpos(tp('1.047'), unique=False, precision=pad_val) with pytest.raises(RuntimeError, - match="Float formating result too large"): + match="Float formatting result too large"): fpos(tp('1.047'), precision=2, pad_left=pad_val) with pytest.raises(RuntimeError, - match="Float formating result too large"): + match="Float formatting result too large"): fpos(tp('1.047'), precision=2, pad_right=pad_val) @pytest.mark.parametrize("tp", available_float_dtypes)