jorenham / scipy-stubs

Typing Stubs for SciPy
https://pypi.org/project/scipy-stubs/
BSD 3-Clause "New" or "Revised" License
17 stars 5 forks source link

array-api compatability #140

Open jorenham opened 1 month ago

jorenham commented 1 month ago

Typing the array API

Our best bet for proper array-api types is optype, but that doesn't exist yet, see jorenham/optype#25. There, I also explain why the official array api "stubs" (which aren't stubs) are completely useless...

Relevant scipy bits

The Array API is partially supported scipy. The following packages support is fully:

Additionally, the following scipy.special functions have array api support:

as well as the following scipy.stats functions:

How Scipy implements it

Internally, scipy implements the support in scipy._lib._array_api. From the looks of it, this module will come with a bunch of extra utility functions in scipy 1.15 (37174ad), as well as an additional scipy._lib._array_api_no_0d module in 281a8c3

Libraries that support it

Some libraries require array-api-compat for them to support the array-api (2022):

the following libraries have native support:

Other relevant links:

jorenham commented 3 weeks ago

blocker: https://github.com/jorenham/optype/pull/170