8000 Apply suggestions from code review · numpy/numpy@2fd869f · GitHub
[go: up one dir, main page]

Skip to content
6604

Commit 2fd869f

Browse files
eendebakptjorenham
andauthored
Apply suggestions from code review
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
1 parent 1ef8eb7 commit 2fd869f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

numpy/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
21522152
def shape(self, value: _ShapeLike) -> None: ...
21532153
@property
21542154
def strides(self) -> _Shape: ...
2155-
@deprecated('setting dtype on an aray is deprecated since Numpy 2.3')
2155+
@deprecated("Setting the strides on a NumPy array has been deprecated in Numpy 2.3")
21562156
@strides.setter
21572157
def strides(self, value: _ShapeLike) -> None: ...
21582158
def byteswap(self, inplace: builtins.bool = ...) -> Self: ...

numpy/_core/src/multiarray/getset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ array_strides_set(PyArrayObject *self, PyObject *obj, void *NPY_UNUSED(ignored))
126126

127127
/* DEPRECATED 2025-05-04, NumPy 2.3 */
128128
int ret = PyErr_WarnEx(PyExc_DeprecationWarning,
129-
"Setting the strides on a Numpy array has been deprecated in Numpy 2.3.\n",
129+
"Setting the strides on a NumPy array has been deprecated in NumPy 2.3.\n",
130130
1);
131131
if (ret) {
132132
return -1;
@@ -385,7 +385,7 @@ array_descr_set(PyArrayObject *self, PyObject *arg, void *NPY_UNUSED(ignored))
385385
// this will not emit deprecation warnings for all cases, but for most it will
386386
/* DEPRECATED 2025-05-04, NumPy 2.3 */
387387
int ret = PyErr_WarnEx(PyExc_DeprecationWarning,
388-
"Setting the dtype on a Numpy array has been deprecated in Numpy 2.3.\n"
388+
"Setting the dtype on a NumPy array has been deprecated in NumPy 2.3.\n"
389389
"Instead of changing the dtype on an array x, create a new array with x.view(new_dtype)",
390390
1);
391391
if (ret) {

numpy/_core/tests/test_deprecations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def __array_wrap__(self, arr):
415415
assert test2.called
416416

417417
class TestDeprecatedArrayAttributeSetting(_DeprecationTestCase):
418-
message = "Setting the .*on a Numpy array has been deprecated.*"
418+
message = "Setting the .*on a NumPy array has been deprecated.*"
419419

420420
def test_deprecated_dtype_set(self):
421421
x = np.eye(2)

0 commit comments

Comments
 (0)
0