Skip to content

[MNT]: Tracking issue for Numpy 2.0 transition #26422

Closed
@ksunden

Description

@ksunden

Summary

This is a tracking issue for all of the things that (will) need to change for numpy 2.0

xref numpy/numpy#24306

Edit 2023-08-03: Updated to list according to numpy/numpy#24306 (comment)

  • Note that almost all (aside from NaN and Inf fall into the "tentative" category, which is to say possibly removed, but not fully decided.

Edit 2023-08-31: Updated to list according to most recent numpy list

Proposed fix

List of functions affected

Most of the changes are relatively simple namespace swaps... but if we wish to be backwards compatible, may require some finagling in the interim

Some of these we may wish to advocate with numpy to keep, particularly some of the things we use that numpy would say "use scipy" for, as I don't think we are prepared to take on scipy as a dependency.

Some of them (e.g. hanning/blackman window functions) it may be better to just vendor or deprecate mlab functions/change examples to avoid using them (we already vendor GaussianKDE...)

Removed from top level, kept/moved to np.linalg

  • np.cross

    • used in proj3d.py, art3d.py
  • np.inner

    • used in test_patches.py
  • np.outer

    • used several places
  • np.transpose

    • used in several places, often with list inputs

Removed from top level, moved to np.dtypes

  • np.iscomplexobj

    • used in mlab.py
  • np.isreal

    • used in cbook.py, bezier.py, test_mlab.py
  • np.isscalar

    • used in _axes.py, cbook.py, figure.py
  • np.issubdtype

    • used in several places, usually in conjuction with other things that are moving
  • np.min_scalar_type

    • used in colors.py
  • np.promote_types

    • used in stackplot.py, colors.py

Removed from top level, moved to np.rec

Removed from top level, kept in np.index_tricks

  • np.c_

    • used in angle_annotation example only
  • np.r_

    • used in test_agg.py and demo_agg_filter.py (example)

Removed in favor of alias/similar func

Fully removed (?)

  • np.isfortran

    • used in test_triangulation.py
  • np.putmask

    • used in colors.py
    • may be replaced by a[mask]=b[mask], but doesn't do repeating behavior, so would have to verif
    • comment supports the idea that a simple replacement is possible
  • np.s_

    • used in cbook, 3dplot example

Possibly renamed, but not settled

  • np.ix_
    • used in _triinterpolate.py, test_image.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions