🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@mattip
Copy link
Member

@mattip mattip commented Jan 30, 2025

This will be the release note once I have a PR number

  • Remove deprecated macros like NPY_OWNDATA from cython interfaces in favor of NPY_ARRAY_OWNDATA (deprecated since 1.7)
  • Remove numpy/npy_1_7_deprecated_api.h and C macros like NPY_OWNDATA in favor of NPY_ARRAY_OWNDATA (deprecated since 1.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)
  • Passing shape=None to functions with a non-optional shape argument raises, use () instead (deprecated since 1.20)
  • Inexact matches for mode and searchside raise (deprecated since 1.20)
  • Setting __array_finalize__ = None raises (deprecated since 1.23)
  • np.fromfile and np.fromstring error on bad data, previously they would guess (deprecated since 1.18)
  • datetime64 and timedelta64 construction with a tuple no longer accepts an event value, either use a two-tuple of (unit, num) or a 4-tuple of (unit, num, den, 1) (deprecated since 1.14)
  • When constructing a dtype from a class with a dtype attribute, that attribute must be a dtype-instance rather than a thing that can be parsed as a dtype instance (deprecated in 1.19). At some point the whole construct of using a dtype attribute will be deprecated (see DEP: Deprecate constructing dtypes from any object having a .dtype attribute #25306)
  • Passing booleans as partition index errors (deprecated since 1.23)
  • Out-of-bounds indexes error even on empty arrays (deprecated since 1.20)
  • np.tostring has been removed, use `tobytes instead (deprecated since 1.19)
  • Disallow make a non-writeable array writeable for arrays with a base that do not own their data (deprecated since 1.17)
  • concatenate() with axis=None uses same-kind casting by default, not unsafe (deprecated since 1.20)
  • Unpickling a scalar with object dtype raises (deprecated since 1.20)
  • The binary mode of fromstring now raises, use frombuffer instead (deprecated since 1.14)
  • Converting np.inexact or np.floating to a dtype errors (deprecated since 1.19)
  • Converting np.complex, np.integer, np.signedinteger, np.unsignedinteger, np.genericto a dtype raises, it used to convert tocomplex128` (deprecated since 1.19)
  • The Python built-in round errors for complex scalars. Use np.round or scalar.round instead (deprecated since 1.19)
  • 'np.bool' scalars can no longer be interpreted as an index (deprecated since 1.19)
  • Parsing an integer via a float string is no longer supported. (deprecated since 1.23) To avoid this error you can
    • make sure the original data is stored as integers.
    • use the converters=float keyword argument.
    • Use np.loadtxt(...).astype(np.int64)
  • The use of a length 1 tuple for the ufunc signature errors. Use dtype or fill the tuple with None (deprecated since 1.19)
  • Special handling of matrix is in np.outer is removed. Convert to a ndarray via matrix.A (deprecated since 1.20)

@mattip
Copy link
Member Author

mattip commented Jan 31, 2025

The benchmarks were using deprecated np.tostring. Is there a way to make sure we raise on deprecation warnings in benchmark runs?

@seberg
Copy link
Member

seberg commented Jan 31, 2025

Very nice, thanks! Have to look through once more, but these all seem straight forward.

The C ones seem potentially higher noise. I think that is acceptable, but maybe we should duplicate a slightly longer release note in the c_api section.

The benchmarks were using deprecated np.tostring. Is there a way to make sure we raise on deprecation warnings in benchmark runs?

Hmmm, we go via the spin command now in .spin/cmds.py. So it is a bit wrapped up, and I think the easiest thing would be to add an export PYTHONWARNINGS=error to the CI run. At least I think that should work, of course there might be more warnings.)

@charris
Copy link
Member

charris commented Jan 31, 2025

There is still a reference to tostring in doc/source/reference/arrays.ndarray.rst:289.

@charris charris modified the milestones: 2.2.3 release, 2.3.0 release Feb 1, 2025
@charris charris changed the title expire deprecations MAINT: expire deprecations Feb 1, 2025
@mattip
Copy link
Member Author

mattip commented Feb 2, 2025

CI is passing

@jorenham
Copy link
Member

jorenham commented Feb 2, 2025

I'll address the remaining stub changes in a follow-up PR

@charris charris merged commit ac4c308 into numpy:main Feb 2, 2025
69 checks passed
@charris
Copy link
Member

charris commented Feb 2, 2025

Thanks Matti. Let's get this in and see how it shakes out.

tacaswell added a commit to tacaswell/pyopencl that referenced this pull request Feb 12, 2025
These were deprecated in np1.7 and will be removed in np2.3 (currently removed
on numpy main branch).

xref numpy/numpy#28254
inducer pushed a commit to inducer/pyopencl that referenced this pull request Feb 13, 2025
These were deprecated in np1.7 and will be removed in np2.3 (currently removed
on numpy main branch).

xref numpy/numpy#28254
@mattip mattip deleted the expire-deprecations branch May 5, 2025 11:22
serge-sans-paille added a commit to serge-sans-paille/pythran that referenced this pull request Jun 8, 2025
serge-sans-paille added a commit to serge-sans-paille/pythran that referenced this pull request Jun 8, 2025
serge-sans-paille added a commit to serge-sans-paille/pythran that referenced this pull request Jun 9, 2025
serge-sans-paille added a commit to serge-sans-paille/pythran that referenced this pull request Jun 11, 2025
serge-sans-paille added a commit to serge-sans-paille/pythran that referenced this pull request Jun 11, 2025
askmeaboutlo0m added a commit to askmeaboutlo0m/mypaint that referenced this pull request Jun 22, 2025
Because numpy removed the former function (in a minor release) with
numpy/numpy#28254. The function was an alias, so there's no change in
behavior, i.e. it always returned bytes.

See also 2a92b6b, where the same
function was already replaced in strokemap.py.
AesaraB pushed a commit to mypaint/mypaint that referenced this pull request Jun 23, 2025
Because numpy removed the former function (in a minor release) with
numpy/numpy#28254. The function was an alias, so there's no change in
behavior, i.e. it always returned bytes.

See also 2a92b6b, where the same
function was already replaced in strokemap.py.
jtojnar pushed a commit to mypaint/mypaint that referenced this pull request Jul 21, 2025
Because numpy removed the former function (in a minor release) with
numpy/numpy#28254. The function was an alias, so there's no change in
behavior, i.e. it always returned bytes.

See also 2a92b6b, where the same
function was already replaced in strokemap.py.

(cherry picked from commit ab017e0)
jtojnar pushed a commit to mypaint/mypaint that referenced this pull request Jul 21, 2025
Because numpy removed the former function (in a minor release) with
numpy/numpy#28254. The function was an alias, so there's no change in
behavior, i.e. it always returned bytes.

See also 2a92b6b, where the same
function was already replaced in strokemap.py.

(cherry picked from commit ab017e0)
jtojnar pushed a commit to mypaint/mypaint that referenced this pull request Jul 21, 2025
Because numpy removed the former function (in a minor release) with
numpy/numpy#28254. The function was an alias, so there's no change in
behavior, i.e. it always returned bytes.

See also 2a92b6b, where the same
function was already replaced in strokemap.py.

(cherry picked from commit ab017e0)
hmaarrfk added a commit to hmaarrfk/transformers.js that referenced this pull request Aug 6, 2025
Deprecated since numpy 1.14 according to
numpy/numpy#28254

This should be the correct fix for huggingface#1343

And after this is merged, one can likely just revert this
huggingface#1351
mbaak pushed a commit to histogrammar/histogrammar-python that referenced this pull request Aug 23, 2025
numpy/numpy#28254
When constructing a dtype from a class with a dtype attribute, that attribute must be a dtype-instance rather than a thing that can be parsed as a dtype instance.

hist.datatype now returns float instead of np.number as datatype.
mbaak pushed a commit to ing-bank/popmon that referenced this pull request Aug 25, 2025
In numpy 2.3, converting np.number to a dtype no longer allowed.

See: numpy/numpy#28254
"When constructing a dtype from a class with a dtype attribute, that attribute must be a dtype-instance rather than a thing that can be parsed as a dtype instance."

hist.datatype now returns float instead of np.number as datatype.
mbaak pushed a commit to ing-bank/popmon that referenced this pull request Aug 26, 2025
- Upgrade to histogrammar v1.1.1
- In numpy 2.3, converting np.number to a dtype no longer allowed.
- See for details: numpy/numpy#28254
- hist.datatype now returns float instead of np.number as datatype.
DerAndereJohannes added a commit to neuropsychology/NeuroKit that referenced this pull request Oct 11, 2025
- None was depricated since numpy 1.20 and removed in 2.3.0
- See numpy/numpy#28254
Janet-king pushed a commit to Janet-king/NeuroKit that referenced this pull request Nov 28, 2025
- None was depricated since numpy 1.20 and removed in 2.3.0
- See numpy/numpy#28254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants