-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update documentation #9
Conversation
@rgommers if you have a chance, can you review this? In addition to the changes in this PR, can you also take a look at the repo as a whole. I think I have everything ready to do an initial release, but I don't know if I forgot anything. I also opened some issues on this repo for ideas of things we can do in the future. But I want to keep the first release as close to the current numpy.array_api as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite good Aaron, I only have a few minor comments.
@@ -0,0 +1,30 @@ | |||
# array-api-strict Changelog | |||
|
|||
## 1.0 (????) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.0 SGTM
CHANGELOG.md
Outdated
extracted from the git history of numpy/array_api/ (see the [README](README.md)). | ||
|
||
Additionally, the following changes are new to `array_api_strict` from | ||
`numpy.array_api` in NumPy 1.26 (the last major NumPy release to include |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`numpy.array_api` in NumPy 1.26 (the last major NumPy release to include | |
`numpy.array_api` in NumPy 1.26 (the last NumPy feature release to include |
README.md
Outdated
standard are included. All signatures in array-api-strict use | ||
[positional-only | ||
arguments](https://data-apis.org/array-api/latest/API_specification/function_and_method_signatures.html#function-and-method-signatures). | ||
As noted above, only array_api_strict array objects are accepted by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting: array_api_strict
needs backticks
README.md
Outdated
arguments](https://data-apis.org/array-api/latest/API_specification/function_and_method_signatures.html#function-and-method-signatures). | ||
As noted above, only array_api_strict array objects are accepted by | ||
functions, except in the places where the standard allows Python scalars | ||
(i.e., functions to not automatically call `asarray` on their inputs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sentence reads slightly awkward to me. maybe it's a typo (to not -> do not)?
README.md
Outdated
|
||
- The | ||
[indexing](https://data-apis.org/array-api/latest/API_specification/indexing.html) | ||
semantics required by the standard are not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incomplete sentence here
README.md
Outdated
|
||
- The array object type itself is private and should not be accessed. | ||
Subclassing or otherwise trying to directly initialize this object is not | ||
supported. Arrays should created with one of the [array creation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "should be created"
|
||
## Caveats | ||
|
||
array-api-strict is a thin pure Python wrapper around NumPy. NumPy 2.0 fully |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest: "NumPy 2.0 has nearly full support for ....", since there are a few aspects that don't comply (e.g., returning scalars)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this, but I was under the impression that scalars were not actually breaking compliance. As long as scalars duck-type as 0-D arrays, which they do, then it's just an implementation detail that numpy has a separate type for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, not sure if the duck-typing really is 100%. there's a few other reasons though, see the "not adopted part in the PR for NEP 56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is NEP 56? Google comes up with nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to continue this discussion over there since this is closed, but that NEP seems to just state that scalars aren't in compliance without actually explaining why. numpy/numpy#25542 (comment)
- Complex number support in array API spec is planned but not yet finalized, | ||
as are the fft extension and certain linear algebra functions such as eig | ||
that require complex dtypes. | ||
array_api_strict is a strict, minimal implementation of the Python array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need backticks here as well
I think it can be shipped as is, however you may want to do some of the following (can be done later):
Good ideas, +1 to both the first release plan and all of those things as follow-ups. |
I'll give this a try with SciPy |
Looks like the switchover is easy and everything works as expected for SciPy. |
I've used versioneer on dozens of projects and never had any issues with it. All the code in versioneer is used for generating development version numbers and doing packaging. The actual resulting package has a very simple file generated in it. Here's what it creates for this branch # This file was generated by 'versioneer.py' (0.29) from
# revision-control system data, or from the parent directory name of an
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.
import json
version_json = '''
{
"date": "2024-01-23T17:55:23-0700",
"dirty": false,
"error": null,
"full-revisionid": "c2d570061e8434b58c4e6609e2a849cf75e6a390",
"version": "0+untagged.193.gc2d5700"
}
''' # END VERSION_JSON
def get_versions():
return json.loads(version_json) Admittedly, even that is more complicated than it could be. It could just generate a file with just `version = ''. But it's way simpler for runtime than, e.g., setuptools_scm, which grabs the version number from the package metadata. I don't like that at all. If you know of a simpler tool I'm open to using it, but I do like to have something that lets me write the version number just once (in the tag). Otherwise I forget to update it, like I recently did for array-api-compat (we can't use versioneer there because of the vendorability requirement). I don't actually care as much about the git hash version thing, although it is nice to have and it occasionally helps with debugging user issues. |
Imho none of these tools are worth it, for a one-line change per release. But okay, I don't have to make the updates here, so your call. |
OK, I'm going to try to do a release. Based on my experience with array-api-compat, getting the auto-deploy to work the first time around can be a little annoying, so I may end up pushing a |
OK, array-api-strict 1.0 has been released. Now I need to create a conda-forge package. |
Great, thanks! |
No description provided.