Describe what extensions are and how to use them#470
Merged
rgommers merged 1 commit intodata-apis:mainfrom Nov 28, 2022
Merged
Conversation
Note that an alternative idea discussed earlier was a separate function `get_extension()`, but IIRC that was not considered a good idea. Now that we have module-level `__getattr__`'s, it should not be a problem for any library to use a specified name like `linalg` or `fft`. Whether the functions in the `linalg` extensions should all be required to exist or not was discussed in data-apisgh-403 (no clear conclusion there). One option discussed there to deal with hard to implement or more niche APIs is to create a separate status/label or some other way to track desired signatures (details to be worked out if we want to go that way).
Member
Author
|
One issue I still punted on was static typing; the type hint for an extension module like |
This was referenced Nov 3, 2022
kgryte
approved these changes
Nov 14, 2022
Member
Author
|
There were no more comments on this. What is here should be pretty straightforward. It also closes issue gh-501, which was opened after this PR. A separate list of signatures for fft/linalg functions that are not included in the standard can always be worked on separately. Let's get this in. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note that an alternative idea discussed earlier was a separate function
get_extension(), but IIRC that was not considered a good idea. Now that we have module-level__getattr__'s, it should not be a problem for any library to use a specified name likelinalgorfft.Whether the functions in the
linalgextensions should all be required to exist or not was discussed in gh-403 (no clear conclusion there). One option discussed there to deal with hard to implement or more niche APIs is to create a separate status/label or some other way to track desired signatures (details to be worked out if we want to go that way).Quoting @shoyer: My two cents is that it would be valuable if the standard specified the interface for these functions, even if not every library is going to implement them. It's really not a big deal to need to look up a compatibility table for advanced linear algebra functionality.
There is something to say for that as well (once we have a single easy to use compatibility table in a central place - see gh-402 and gh-462); I see both pros and cons. The pro is easy:
Concerns I have are:
medianfunction, but we left it out on purpose because it's not great for distributed libraries; themedianinterface is not available anywhere in this repo).