diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b283086e3..34a0610bd18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum * Refactored `dpnp.fft` and `dpnp.random` submodules by removing wildcard imports and defining explicit public exports [#2649](https://github.com/IntelPython/dpnp/pull/2649) * Added support for the `out` keyword to accept a tuple, bringing ufunc signatures into alignment with those in NumPy [#2664](https://github.com/IntelPython/dpnp/pull/2664) * Unified public API definitions in `dpnp.linalg` and `dpnp.scipy` submodules [#2663](https://github.com/IntelPython/dpnp/pull/2663) +* Aligned the signature of `dpnp.reshape` function with Python array API by making `shape` a required argument [#2673](https://github.com/IntelPython/dpnp/pull/2673) ### Deprecated diff --git a/dpnp/dpnp_iface_manipulation.py b/dpnp/dpnp_iface_manipulation.py index cfd0bdca637..7d4eddab6e4 100644 --- a/dpnp/dpnp_iface_manipulation.py +++ b/dpnp/dpnp_iface_manipulation.py @@ -3013,7 +3013,7 @@ def require(a, dtype=None, requirements=None, *, like=None): return arr -def reshape(a, /, shape=None, order="C", *, copy=None): +def reshape(a, /, shape, order="C", *, copy=None): """ Gives a new shape to an array without changing its data. @@ -3028,8 +3028,6 @@ def reshape(a, /, shape=None, order="C", *, copy=None): an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions. - - Default: ``None``. order : {None, "C", "F", "A"}, optional Read the elements of `a` using this index order, and place the elements into the reshaped array using this index order. ``"C"`` @@ -3113,11 +3111,6 @@ def reshape(a, /, shape=None, order="C", *, copy=None): """ - if shape is None: - raise TypeError( - "reshape() missing 1 required positional argument: 'shape'" - ) - if order is None: order = "C" elif order in "aA":