Repository navigation
NDArray: document the axis, positional and axis: - #45
Merged
Merged
Conversation
… since ruby#883 The page listed the reductions and showed `a.sum`, so a reader had no way to learn that `sum`/`prod`/`mean`/`max`/`min`/`argmax`/`argmin` reduce along an axis at all, let alone that go-embedded-ruby/ruby#883 taught them NumPy's `axis:` spelling. `cumsum` was missing from the list entirely. Every figure in the new example was taken from a real run of rbgo built at go-embedded-ruby/ruby@6eb7e4ad, not from reading the binding: p a.sum # => 15.0 p a.sum(axis: 0).to_a # => [3.0, 5.0, 7.0] p a.argmax(axis: 1).to_a # => [2.0, 2.0] The same run confirms the two statements the prose makes: `a.sum(0)` and `a.sum(axis: 0)` return the same array, and `a.sum(0, axis: 0)` raises ArgumentError("axis given both positionally and as a keyword"). numericsurface against that binary: 258 names over 11 module sections, 0 disagree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The NDArray section listed the reductions and showed
a.sum, so nothing on thepage said they reduce along an axis at all — and nothing said that
go-embedded-ruby/ruby#883 taught them NumPy's
axis:spelling.cumsumwasmissing from the list entirely.
Every figure in the new example came from a real run of rbgo built at
go-embedded-ruby/ruby@6eb7e4ad, not from reading the binding:
That last line is what
a.sum(0, axis: 0)raises, which is the other claim theprose makes.
numericsurfaceagainst the same binary: 258 names over 11 module sections,0 disagree.
Separate from #44 on purpose: that one moves the conformance figure and this
one documents a method surface. They touch different files and neither needs
the other.
🤖 Generated with Claude Code