Skip to content

Array API support tracker #140

@jorenham

Description

@jorenham

upstream tracker: scipy/scipy#18867

Typing the array API

... that'll have to wait until someone manages to find the time to work on array-api-typing 😅

Relevant scipy bits

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

  • cluster
    • vq
      • whiten
      • [py_]vq
      • kmeans[2]
    • hierarchy
      • int_floor
      • linkage (used by single, complete, average, weighted, centroid, median, ward)
      • {cut,to}_tree
      • optimal_leaf_ordering
      • cophenet
      • inconsistent
      • {from,to}_mlab_linkage
      • is_monotonic
      • is_valid_{im,linkage}
      • num_obs_linkage
      • correspond
      • fcluster[data]
      • leaves_list
      • dendrogram
      • max{dists,inconsts,Rstat}
      • leaders
  • constants
    • convert_temperature
    • lambda2nu [1.16+]
    • nu2lambda [1.16+]
  • datasets
  • differentiate [1.15+]
    • derivative
    • jacobian
    • hessian
  • fft
    • [i][r|h]fft[2|n]
    • [i]dct[n]
    • [i]dst[n]
    • [r]fftfreq
    • [i]fftshift
  • integrate [1.15+]
    • cubature
    • tanhsinh
    • trapezoid
    • nsum
  • io
  • linalg (not yet, see scipy/scipy#19068)
  • ndimage
    • vectorized_filter [1.16+]
  • optimize
    • _differentiable_functions
    • elementwise.* [1.15+]
    • rosen[_{der,hess,hess_prod}] [1.15+]
  • signal (see scipy/scipy#20678)
    • findfreqs [1.16+]
    • freqs[_{zpk,sos}] [1.16+]
    • freqz[_{zpk,sos}] [1.16+]
    • envelope [1.16+]
    • resample[_poly] [1.16+]
    • remez [1.16+]
    • fir{win[2],ls} [1.16+]
    • minimum_phase [1.16+]
    • zpk2{tf,sos} [1.16+]
    • tf2{zpk,sos} [1.16+]
    • sos2{tf,zpk} [1.16+]
    • lp2{lp,hp,bp,bs} [1.16+]
    • vectorstrength [1.16+]
    • upfirdn [1.16+]
  • signal.windows [1.16+] (ENH: signal.windows: add array API support (take 2) scipy#21783)
  • sparse (not yet, see scipy/scipy#18867)
  • special
    • log_ndtr
    • ndtr[i]
    • chdtr [1.15+]
    • chdtrc
    • erf[c]
    • i0[e]
    • i1[e]
    • betainc[c] [1.15+]
    • gammaln
    • gammainc[c]
    • {log,exp}it
    • [rel_]entr
    • xlogy
    • stdtrit [1.16+]
    • [log_]softmax [1.16+]
    • logsumexp [1.16+]
  • stats (see scipy/scipy#20544)
    • describe
    • moment
    • variation
    • sem
    • skew
    • kurtosis
    • kstat[var]
    • z{map,score} [1.15+]
    • gzscore [1.15+]
    • gstd [1.16+]
    • t{mean,var,str,sem,min,max} [1.15+]
    • {g,h,p,t}mean [1.15+]
    • quantile [1.16+]
    • rankdata [1.16+]
    • entropy
    • differential_entropy [1.15+]
    • power_divergence
    • circ{mean,var,std}
    • directional_stats [1.15+]
    • ttest_{1samp,ind,ind_from_stats,rel} [1.15+]
    • {skew,kurtosis,normal,monte_carlo}test
    • pearsonr
    • chisquare
    • jarque_bera
    • bartlett
    • boxcox_llf [1.15+]
    • combine_pvalues [1.15+]

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions