chore: migrate math/iter/special examples to random/iter/uniform#11950
Open
Planeshifter wants to merge 7 commits intodevelopfrom
Open
chore: migrate math/iter/special examples to random/iter/uniform#11950Planeshifter wants to merge 7 commits intodevelopfrom
math/iter/special examples to random/iter/uniform#11950Planeshifter wants to merge 7 commits intodevelopfrom
Conversation
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` plus an `iterAdd` shift to a single `@stdlib/random/iter/uniform( -2.0, 2.0, ... )` call. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special` and matches the sign-sensitive cluster (`signum`, `ramp`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` plus an `iterAdd` shift to a single `@stdlib/random/iter/uniform( -2.0, 2.0, ... )` call. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special` and matches the sign-sensitive cluster (`signum`, `ramp`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` to `@stdlib/random/iter/uniform( 0.0, 6.28, ... )`, sampling across one full period rather than `[0, 1)`. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special`; the `(0.0, 6.28)` interval matches the trig-period cluster (`cosm1`, `coversin`, `havercos`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` to `@stdlib/random/iter/uniform( 0.0, 2.0, ... )`, sampling across one full period of `cos(πx)` rather than `[0, 1)`. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special`; the `(0.0, 2.0)` interval matches the period-2 cluster (`acovercos`, `acoversin`, `aversin`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` to `@stdlib/random/iter/uniform( 1.0, 10.0, ... )`, avoiding the near-zero values that produce uninformative large outputs from `1/x`. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special`; the `(1.0, 10.0)` interval matches the singularity-avoiding cluster (`acosh`, `acoth`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` to `@stdlib/random/iter/uniform( 0.0, 6.28, ... )`, sampling across one full period rather than `[0, 1)`. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special`; the `(0.0, 6.28)` interval matches the trig-period cluster (`cosm1`, `coversin`, `havercos`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Migrate the example pseudorandom source from `@stdlib/random/iter/randu` to `@stdlib/random/iter/uniform( 0.0, 2.0, ... )`, sampling across one full period of `sin(πx)` rather than `[0, 1)`. The `uniform`-based pattern is used by 88 of 97 (90.7%) sibling packages in `math/iter/special`; the `(0.0, 2.0)` interval matches the period-2 cluster (`acovercos`, `acoversin`, `aversin`). https://claude.ai/code/session_01CqGYLHLpXrp7baqtrMoRgx
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
math/iter/special examples to random/iter/uniformmath/iter/special examples to random/iter/uniform
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.
Description
This pull request migrates the
examples/index.jsfile (and the matching inline code block inREADME.md) for seven packages underlib/node_modules/@stdlib/math/iter/special/from the legacy@stdlib/random/iter/randupseudorandom source to the conventional@stdlib/random/iter/uniformsource, using a sampling interval matched to each function's mathematical domain.Namespace summary
@stdlib/random/iter/uniform( a, b, { 'seed': 1234, 'iter': 10 } ); 9 deviate.factorial,factorialln(use@stdlib/random/iter/discrete-uniformbecause the underlying functions are integer-valued).abs,abs2,cos,cospi,inv,sin,sinpi.Per-outlier corrections
math/iter/special/absMigrates
examples/index.jsand the correspondingREADME.mdcode block from the legacyrandu+iterAdd(rand, -0.5)shift pattern to@stdlib/random/iter/uniform( -2.0, 2.0, ... ). The shift approach was a workaround that obscured intent; theuniformiterator expresses the range directly. Interval precedent follows thesignumandrampsibling cluster (90.7% conformance).math/iter/special/abs2Migrates
examples/index.jsand the correspondingREADME.mdcode block from the legacyrandu+iterAdd(rand, -0.5)shift pattern to@stdlib/random/iter/uniform( -2.0, 2.0, ... ). As withabs, the shift was an implicit range selection with no documented rationale. Interval follows thesignumandrampsibling cluster (90.7% conformance).math/iter/special/cosMigrates
examples/index.jsand the correspondingREADME.mdcode block fromranduto@stdlib/random/iter/uniform( 0.0, 6.28, ... ), spanning one full period of cosine. The[0, 1)output ofranduexercised only a fraction of the function's domain. Interval follows thecosm1,coversin, andhavercossibling cluster (90.7% conformance).math/iter/special/cospiMigrates
examples/index.jsand the correspondingREADME.mdcode block fromranduto@stdlib/random/iter/uniform( 0.0, 2.0, ... ), spanning one full period ofcos(πx). The[0, 1)range ofranducovered only half a period of the scaled argument. Interval follows theacovercos,acoversin, andaversinsibling cluster (90.7% conformance).math/iter/special/invMigrates
examples/index.jsand the correspondingREADME.mdcode block fromranduto@stdlib/random/iter/uniform( 1.0, 10.0, ... ). Values drawn from[0, 1)caused1/xto blow up near zero, producing outputs that were uninformative for demonstration purposes. Interval follows theacoshandacothsibling cluster (90.7% conformance).math/iter/special/sinMigrates
examples/index.jsand the correspondingREADME.mdcode block fromranduto@stdlib/random/iter/uniform( 0.0, 6.28, ... ), spanning one full period of sine. Migration shape is identical tocos. Interval follows thecosm1,coversin, andhavercossibling cluster (90.7% conformance).math/iter/special/sinpiMigrates
examples/index.jsand the correspondingREADME.mdcode block fromranduto@stdlib/random/iter/uniform( 0.0, 2.0, ... ), spanning one full period ofsin(πx). Migration shape is identical tocospi. Interval follows theacovercos,acoversin, andaversinsibling cluster (90.7% conformance).Related Issues
None.
Questions
No.
Other
Validation
package.jsontop-level keys,package.jsonscripts, andREADME.mdsection structure (## Usage,## Notes,## Examples,## See Also).lib/main.jsof every member) confirmed uniform JSDoc shape (@param/@returns/@throwstypes), uniform error-handling delegation to the underlyingiter/tools/map/iter/tools/map2, and identified the example pseudorandom source as the only feature with detectable drift.confirmed-driftand confirmedfactorial/factoriallnasintentional-deviation.atan2,beta,betaln,log,pow) whose 2-arg signature reflects a genuine semantic difference and is not drift;factorial,factorialln, which intentionally usediscrete-uniformbecause the underlying functions are integer-valued.Each correction was committed as a separate commit, one per package, so the audit trail is per-package rather than per-feature.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of a cross-package API drift detection routine: the random target namespace was selected, structural and semantic features were extracted across all 97 members, a 90.7% majority pattern was identified for the example pseudorandom source, three validation agents (two opus, one sonnet) confirmed the 7 outliers as unintentional drift, and the corrections were applied mechanically.
@stdlib-js/reviewers
Generated by Claude Code