-
Notifications
You must be signed in to change notification settings - Fork 52
Small formatting fixes to make the spec parsable by the test suite scripts #133
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
Conversation
__div__ is a relic from Python 2. It no longer does anything in Python 3. The reflected operators were missing __rmatmul__. Now they completely match the in-place operators.
I also pushed a fix to the in-place and reflected operators. I noticed we don't have Also |
The rule said that empty slices should work, but the note right below that says that they are optional.
Since this PR is still open, I also pushed a fix to an issue I noticed with the indexing spec. It was ambiguous whether empty slices are required or optional. I removed the text that said they were required and left in the note that said they are optional. Assuming this is indeed what we want, should the NumPy array API namespace indexing support empty slices? |
spec/API_specification/indexing.md
Outdated
@@ -105,11 +105,6 @@ Slice syntax must have the following defaults. Let `n` be the axis (dimension) s | |||
- If `k` is greater than `0` and `j` is not provided (e.g., `0::2`), `j` must equal `n`. | |||
- If `k` is less than `0` and `i` is not provided (e.g., `:10:-2`), `i` must equal `n-1`. | |||
- If `k` is less than `0` and `j` is not provided (e.g., `0::-2`), `j` must equal `-n-1`. | |||
|
|||
Using a slice to index a single array axis must adhere to the following rules. Let `n` be the axis (dimension) size. |
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 line should not be removed. Otherwise, the item defined by L113 will look like it belongs to the list ending at L107.
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.
Well that was also confusing to me. The two lists both seem like they are about the same thing (the behavior of a slice on an axis of size n
).
To split hairs a bit, the rule you removed was referring to the case where |
This reverts commit d9d51aa.
Oh I think you are right. I will revert the commit. |
I guess the reason it confused me is that this isn't the only way to get an empty slice. As long as the element indexed by stop is before the start (or after for negative step), the slice is empty. For example, I'm unclear which cases we should allow or disallow in the NumPy array API. Should we disallow any slice that results in an empty selection except for the case where start == stop? |
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.
No description provided.