docs: normalize return type and keyword in ml/base/kmeans collection packages#13524
Draft
Planeshifter wants to merge 2 commits into
Draft
docs: normalize return type and keyword in ml/base/kmeans collection packages#13524Planeshifter wants to merge 2 commits into
ml/base/kmeans collection packages#13524Planeshifter wants to merge 2 commits into
Conversation
Normalize the domain keyword in the `keywords` array from the plural `algorithms` to the singular `algorithm`. This matches the mirror collection package `ml/base/kmeans/metrics` (which uses `metric`) and the sibling `algorithm-*` resolver packages; 9/10 namespace members use a singular domain keyword. The plural was an inadvertent copy artifact and appears in no sibling package. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FTLvLifsfJWGfMYJAJZ11h
Correct the `@returns` JSDoc type on the main export from `StringArray` to `Array<string>`, matching the mirror collection package `ml/base/kmeans/algorithms` and the TypeScript declaration present in both packages (`declare function metrics(): Array<string>;`). The function returns `DATA.slice()`, a plain string array, so `Array<string>` is the canonical type; `StringArray` contradicted the package's own type declaration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FTLvLifsfJWGfMYJAJZ11h
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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.
Resolves None.
Description
This pull request normalizes two internal documentation/metadata inconsistencies in the
ml/base/kmeansenumeration-table packages, bringing thealgorithmsandmetricsmirror packages into agreement with each other and with their sibling packages:ml/base/kmeans/metricsThe main export documented its return type as
@returns {StringArray}, contradicting both the mirroralgorithmspackage (Array<string>) and this package's own TypeScript declaration (declare function metrics(): Array<string>;). The function returnsDATA.slice()— a plain string array — identical toalgorithms. Corrected the JSDoc to{Array<string>}.ml/base/kmeans/algorithmsThe
keywordsarray carried the pluralalgorithms; every other namespace member uses a singular domain keyword (the mirrormetricsusesmetric; thealgorithm-*resolvers usealgorithm). 9/10 members use the singular form. Switched toalgorithm.Related Issues
None.
Questions
No.
Other
Both changes are documentation/metadata only — no runtime behavior, public signature, or test-expectation changes. Conformance: the
Array<string>return type is used by the mirroralgorithmspackage and by both packages'.d.tsdeclarations; the singular-keyword convention holds for 9/10 members of the namespace. The two collection packages (algorithms,metrics) are otherwise byte-identical modulo their enum contents and domain nouns, which is what surfaced these two asymmetries.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code. It analyzed the
ml/base/kmeansnamespace for cross-package drift, compared each package's structural and semantic features against the majority pattern of its siblings, identified the two inconsistencies above, and applied the fixes. Each change was verified against the mirror package and the TypeScript declarations before committing.@stdlib-js/reviewers
Generated by Claude Code