Skip to content

select_range params in scipy.linalg._decomp can only be int{16,32,64} if select="i" #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorenham opened this issue Nov 2, 2024 · 0 comments · Fixed by #165
Closed
Labels
scipy.linalg stubs: improvement Improve or refactor existing annotations
Milestone

Comments

@jorenham
Copy link
Collaborator

jorenham commented Nov 2, 2024

In #153 (comment) @pavyamsiri discovered that the the private _EigSelectRange type-alias in scipy.linalg._decomp is too broad if select.lower() in {2, "i", "index"}.

https://github.com/jorenham/scipy-stubs/blob/1318f8438051822d1dca15b5a3d5f0aad40f260b/scipy-stubs/linalg/_decomp.pyi#L26C1-L26C16

https://github.com/scipy/scipy/blob/v1.14.1/scipy/linalg/_decomp.py#L645-L650

Note that because _EigSelectRange is only used for parameter types (i.e. contravariantly), this technically isn't a bug. But even so, disallowing int8 in this case could be very helpful to avoid crashes at runtime.

@jorenham jorenham added scipy.linalg stubs: improvement Improve or refactor existing annotations labels Nov 2, 2024
@jorenham jorenham changed the title scipy.linalg.eigh_tridiagonal scipy.linalg.eigh_tridiagonal shouldn't accept int8 Nov 2, 2024
@jorenham jorenham added this to the 1.14.1.3 milestone Nov 4, 2024
@jorenham jorenham changed the title scipy.linalg.eigh_tridiagonal shouldn't accept int8 the select_range params in scipy.linalg._decomp shouldn't accept int8 Nov 5, 2024
@jorenham jorenham changed the title the select_range params in scipy.linalg._decomp shouldn't accept int8 select_range params in scipy.linalg._decomp can only be int{16,32,64} if select="i" Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scipy.linalg stubs: improvement Improve or refactor existing annotations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant