FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

TYP: fix stubtest errors in ``numpy.lib._arraysetops_impl`` by jorenham · Pull Request #28528 · numpy/numpy · GitHub

Repository navigation

TYP: fix stubtest errors in numpy.lib._arraysetops_impl - #28528

Merged
charris merged 1 commit into
numpy:mainfrom
jorenham:numtype/234
Mar 15, 2025
Merged

charris merged 1 commit into
numpy:mainfrom
jorenham:numtype/234

Conversation

Copy link
Copy Markdown
Member

Ported from numpy/numtype#234


This fixes the signatures of the following public numpy members:

  • unique
  • unique_all
  • unique_counts
  • unique_inverse
  • unique_values
  • intersect1d
  • ediff1d

Ported from numpy/numtype#234

---

This fixes the signatures of the following public `numpy` members:

- `unique`
- `unique_all`
- `unique_counts`
- `unique_inverse`
- `unique_values`
- `intersect1d`
- `ediff1d`
jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing numtype Isssue/PR related to numpy/numtype labels Mar 14, 2025

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

xarray (https://github.com/pydata/xarray)
+ xarray/core/indexing.py: note: In function "_decompose_vectorized_indexer":
+ xarray/core/indexing.py:1144: error: Argument 1 to "append" of "list" has incompatible type "ndarray[tuple[int, ...], dtype[Any]]"; expected "slice[Any, Any, Any]"  [arg-type]
+ xarray/core/indexing.py:1145: error: Argument 1 to "append" of "list" has incompatible type "ndarray[Any, Any]"; expected "slice[Any, Any, Any]"  [arg-type]
+ xarray/core/indexing.py: note: At top level:

scipy (https://github.com/scipy/scipy)
+ scipy/spatial/tests/test_spherical_voronoi.py:255: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "list[ndarray[tuple[int, ...], dtype[Any]]]")  [assignment]

jorenham marked this pull request as draft March 14, 2025 23:44
jorenham marked this pull request as ready for review March 14, 2025 23:51

jorenham commented Mar 14, 2025 •
edited
Loading

Copy link
Copy Markdown
Member Author

The new mypy_primer errors (xarray, scipy) are mypy-only errors that are related to reassignment, similar to the mypy-only errors we have seen before with the 2.2 release.

charris merged commit f925baf into numpy:main Mar 15, 2025

charris commented Mar 15, 2025

Copy link
Copy Markdown
Member

Thanks Joren.

jorenham deleted the numtype/234 branch March 15, 2025 19:09
jorenham removed the 09 - Backport-Candidate PRs tagged should be backported label Mar 15, 2025

jorenham commented Mar 15, 2025 •
edited
Loading

Copy link
Copy Markdown
Member Author

This one might be a bit too risky to backport.

Mypy is working on fixing the underlying issue, though: python/mypy#18727

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

41 - Static typing numtype Isssue/PR related to numpy/numtype

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL