Numpy 2.0 BoF Scipy2024

Give us feedback on the release of NumPy 2.0! Please tell us things that you think we did well and things we did wrong or could have done better.

Notes

  • changes in packaging

    • Dealing with numpy.distutils removal
    • Comparison example project with meson-python
    • deep water with meson co-aligning with numpy 2.0
    • 🔧 More meson-python docs!
  • CI issues due to dependencies not rebuilding with NumPy 2.0

    • scikit-image had to do a lot
    • thought tracking issues & communicating was well done
  • Ruff rule and detailed warnings / transition notes appreciated

  • Release cycle scheduling question (==> 🔧 we need to be more clear that the major number is not semver major number, the minor is basically acts as semver major)

  • what happened with python 3.9 support? How did that came up in discussions and what was the decision process?

  • NumPy compatibility with Array API; example, adding two 0-d arrays gives scalar:

    ​​In [28]: type(np.array(3) + np.array(4))
    ​​Out[28]: numpy.int64
    
    • Scalars
      • Specific use-case CuPy: slice one element out of array -> 0d array
    • 🔧 Something we should raise at next community call?
  • Array API-like standardization of random API

Questions

  • Question to the room: Did you know how to test against the nightly wheels?
    • Lars (scikit-image): didn't know how to integrate pre-releases in cibuildwheels in the beginning. Though, bigger pain points where dependencies that didn't support NumPy 2 yet
  • Question to the room: what are your thoughts on NumPy functions returning scalars in most cases that a 0-d array would be appropriate? (e.g. sum of two 0-d arrays, reduction operation on 1-d array). I was surprised that NumPy 2.0 is still incompatible with the array API standard in this regard. Follow-up: suppose this could be patched. Could it be done in a minor release, or do we need to wait for NumPy 3.0?

Optional place for Feedback

Select a repo