Skip to content

Add a description of how to adopt the API #33

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

Merged
merged 5 commits into from
Oct 22, 2020
Merged

Add a description of how to adopt the API #33

merged 5 commits into from
Oct 22, 2020

Conversation

rgommers
Copy link
Member

@rgommers rgommers commented Sep 8, 2020

Ref discussion from 20 Aug, and gh-16. The thing I left out of this text is a global dispatch. The last point made on that was:

... there is some inherent difficulties. Local dispatch is the more
straightforward approach, but difficulties arise when you want a
particular function to use a particular backend implementation.

and I wasn't quite sure if that concern is valid - maybe I'm missing some details. If the "you" in there is the library author, then they should just ignore the whole API standard namespace and just do

import lib_I_want
lib_I_want.<somefunc>

If the "you" is the end user, then they normally would pass in an array of the right type that would control this. So the one case I see where the concern applies is if there is some function that does not take any array input, but creates arrays internally and the default array type for that creation is somehow undesirable. That seems a bit unlikely.

implementation to access the API namespace, namely a function:

```
mod = x.__array_namespace__(api_version='2020.10')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the last call, everyone seemed happy with this.

Ref discussion from 20 Aug. The thing I left out of this text
is a global dispatch. The last point made on that was:

    ... there is some inherent difficulties. Local dispatch is the more
    straightforward approach, but difficulties arise when you want a
    particular function to use a particular backend implementation.

and I wasn't quite sure if that concern is valid - maybe I'm missing
some details. If the "you" in there is the library author, then
they should just ignore the whole API standard namespace and just do
`import lib_I_want; lib_I_want.<somefunc>`.
If it is the end user, then they normally would pass in an array of
the right type that would control this. So the one case I see where
the concern applies is if there is some function that does _not_ take
any array input, but creates arrays internally _and_ the default array
type for that creation is somehow undesirable. That seems a bit
unlikely.
@rgommers rgommers merged commit 5ce386a into master Oct 22, 2020
@rgommers rgommers deleted the how-to-adopt branch October 22, 2020 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants