Version 0.61.2 (07 April 2025)

This is a maintenance release that adds support for NumPy 2.2 and fixes some regressions reported against 0.61.0.

Highlights

Support for NumPy 2.2

Numba now supports NumPy 2.2, with the following notable changes:

  • np.empty(0) cannot be treated as a boolean value anymore. This is a breaking change for code that relies on this behavior. The following code will raise a ValueError:

    import numpy as np
    if np.empty(0):
        print("This will not be printed")
    
  • Generic timedeltas can no longer be hashed due to undefined time units.

  • From NumPy 2.2 onwards, hash values for numpy.timedelta64 and numpy.datetime64 instances computed in Numba compiled code do not match the NumPy hash values of the same. Prior to NumPy 2.2, NumPy hash values for numpy.timedelta64 and numpy.datetime64 instances were equivalent to their integer value representation. From NumPy 2.2 onwards, their hash value is the same as the hash of the equivalent type from the built-in datetime module, Numba does not replicate this behaviour.

  • np.trimzeros now also trims \0 values.

(PR-#9919)

Bug Fixes

Fix static type checker support for numba.core.types

When Numba 0.61 introduced the split type system, it resulted in dynamic type behavior that was incompatible with static type checkers. To resolve this, we’ve added a type stub file (.pyi) for numba.core.types that provides explicit type annotations.

(PR-#9945)

Fix issue in code generation for array set-slice.

The code generation for array set-slice was inadvertently written as being CPU target specific. This is now rectified and refactored so as to provide a “generic” target version that should be safe to use everywhere, along with an @overload-able stub to allow targets to implement custom versions as needed.

(PR-#9972)

Pull-Requests:

  • PR #9919: Support for NumPy 2.2 (kc611)

  • PR #9920: adding win-64 builder for Numba conda packages (swap357 esc)

  • PR #9940: add GHA workflow for building numba wheels for win-64 (swap357)

  • PR #9945: Add type stub to numba.core.types to help static type checkers. (sklam)

  • PR #9964: remove upper pin on NumPy (esc)

  • PR #9965: update win-64 conda builder test matrix (swap357)

  • PR #9972: Fix issue with error handling in slice assignment. (stuartarchibald)

  • PR #9999: Added release notes and version table entry for 0.61.1rc1 (kc611)

  • PR #10002: GHA workflows and other cherry picks for release0.61.1 (sklam swap357 kc611)

Authors: