Questions related to adoption #120
Copy link
Copy link
Closed
Labels
Tracking IssueTracking issue.Tracking issue.
Description
Here's a list of questions that we need to think about when driving adoption in both array/tensor libraries, and further downstream.
- Do we want array libraries to adopt this into a public or private namespace. I.e., only accessible via
arrayobject.__array_namespace__()or additionally via a direct import? If the latter, what should it be named? related to How to expose API to downstream libraries? #16 - What is the design pattern to work around
np.asarrayin downstream libraries? - Now that we have some features that are kind of optional (e.g., boolean indexing), can we define and should we recommend a testing strategy to figure out how portable some piece of code really is? Also relevant if libraries add extra things into the standard module because it's too hard to remove (e.g., methods on array object).
- Should we have a central place to track adoption and compliance level?
- Can downstream libraries sanely use type annotations when supporting multiple array libraries? (related to the
Protocolmentioned in the Static typing section)
Please add more questions if you can think of them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Tracking IssueTracking issue.Tracking issue.
Activity
rgommers commentedon Jan 29, 2021
Two options were suggested here:
numpy.ndarray, but wraps it and forwards all the calls. Performance isn't important here after all.array_apinamespace only include the APIs in the standard.shoyer commentedon Jan 30, 2021
I opened #122 for this one before I saw this issue :)
shoyer commentedon Jan 30, 2021
np.ndarrayfor use inisinstanceor type annotations? Perhaps we should include the equivalent of anArraybase class as part of the spec.__array_namespace__()provides the same information, but it's less convenient to use.rgommers commentedon Feb 16, 2021
Some thoughts on this:
isinstanceis probably not enough reason to do it.isinstanceisn't too useful in general I'd say. the first thing some function using arrays will do is use__array_namespaceon its inputs already.typing.Protocolcan be done in the spec, and would be useful to include I think.rgommers commentedon Feb 16, 2021
Tentative answer: yes, make it available as a direct import, and name it
array_api.leofang commentedon Apr 3, 2021
How to specify
devicefor the very first array? -> #156kgryte commentedon Apr 4, 2024
This should now be supported via the inspection API where you can query the list of supported devices.
kgryte commentedon Apr 4, 2024
This should now be satisfied via https://github.com/data-apis/array-api-strict.
[-]tracking issue - questions related to adoption[/-][+]Questions related to adoption[/+]