Skip to content

fix: Make type hints compatible with numpy >= 2.4.x#260

Merged
bkeryan merged 3 commits intomainfrom
users/bkeryan/numpy-2.4.x
Feb 4, 2026
Merged

fix: Make type hints compatible with numpy >= 2.4.x#260
bkeryan merged 3 commits intomainfrom
users/bkeryan/numpy-2.4.x

Conversation

@bkeryan
Copy link
Collaborator

@bkeryan bkeryan commented Feb 2, 2026

What does this Pull Request accomplish?

Update to NumPy 2.4.2. Release notes: https://numpy.org/doc/stable/release/2.4.0-notes.html

Make necessary retrofits:

  • npt.DTypeLike no longer includes None, so we must use npt.DTypeLike | None when we want to accept None.
  • np.unpackbits() and ndarray.reshape() now have shape typing, so we should not reuse variable names when reshaping arrays.

Why should this Pull Request be merged?

NumPy 2.4 includes several type hint changes which affect our code.

What testing has been done?

Ran mypy, pyright, pytest

@bkeryan bkeryan requested a review from csjall as a code owner February 2, 2026 19:12
@bkeryan bkeryan mentioned this pull request Feb 2, 2026
1 task
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

Test Results

    56 files  +    17      56 suites  +17   26m 52s ⏱️ + 9m 38s
 2 322 tests +    13   2 322 ✅ +    13   0 💤 ±0  0 ❌ ±0 
66 412 runs  +20 578  66 400 ✅ +20 574  12 💤 +4  0 ❌ ±0 

Results for commit d6a7023. ± Comparison against base commit 3304c17.

♻️ This comment has been updated with latest results.

@bkeryan bkeryan changed the title chore: Update to numpy 2.4.2 fix: Make type hints compatible with numpy 2.4.2 Feb 4, 2026
@bkeryan bkeryan changed the title fix: Make type hints compatible with numpy 2.4.2 fix: Make type hints compatible with numpy >= 2.4.x Feb 4, 2026
@bkeryan bkeryan merged commit 90b8cd7 into main Feb 4, 2026
53 of 62 checks passed
@bkeryan bkeryan deleted the users/bkeryan/numpy-2.4.x branch February 4, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants