Conversation
Adds the `// Negative scale parameter:` `@example` block to the JSDoc in `lib/main.js` and the `interface CDF` main signature JSDoc in `docs/types/index.d.ts`. The block documents `cdf( 2.0, 0.0, -1.0 )` returning `NaN`, which the `sigma <= 0.0` validation guard already enforces and which the package README and `docs/repl.txt` already document. The block is present in 4/5 sibling lognormal `(x, mu, sigma)` packages (`pdf`, `logpdf`, `logcdf`, `quantile`); `cdf` was the lone outlier at 80% sibling conformance.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
May 11, 2026
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:
// Negative scale parameter:@exampleblock to the JSDoc inlib/main.jsand to theinterface CDFmain signature JSDoc indocs/types/index.d.tsfor@stdlib/stats/base/dists/lognormal/cdf, bringing the package's JSDoc and TypeScript declarations into conformance with the four sibling(x|p, mu, sigma)lognormal packages.Namespace summary
@stdlib/stats/base/dists/lognormalcdf,ctor,entropy,kurtosis,logcdf,logpdf,mean,median,mode,pdf,quantile,skewness,stdev,variance)package.jsontop-level /scripts/directories/keywordskeys, README section sequence,manifest.jsonshape, test/benchmark/examples filenames, public signature, return kind, validation prologue, error construction, JSDoc shape (param tags / returns / throws /@exampleblocks),lib/main.jsrequiredependencies.package.jsontop-level key set (100%);directorieskeysbenchmark/doc/example/lib/test(100%); README sections## Usageand## Examples(100%); 11/14 = 79% conformance on the canonicalisnan(mu) || isnan(sigma) || sigma <= 0.0validation prologue; 13/14 = 93% onerrorConstruction = "none"; 14/14 onreturnKind = "value"; 14/14 onjsdocShape.hasExample; 4/5 = 80% on the// Negative scale parameter:@exampleblock inlib/main.jsJSDoc anddocs/types/index.d.tsinterface JSDoc among(x|p, mu, sigma)packages.manifest.json,binding.gyp,include.gypi,src/**,lib/native.js,benchmark/c/**,benchmark/benchmark.native.js,examples/c/**,test/test.native.js) and## C APIsREADME section at 10/14 = 71%;gypfilepackage.jsonkey at 10/14 = 71%;keywordsarray contents (varies by function semantics); public signature shape (split(mu, sigma)/(x, mu, sigma)/(p, mu, sigma)/(mu?, sigma?)constructor — no shape ≥75%); test fixture style (Julia vs R,data.jsonvs*_location.json/*_mean.json).stats/base/dists/lognormal/cdfAdds a
// Negative scale parameter:@exampleblock to the JSDoc inlib/main.jsand to theinterface CDFsignature indocs/types/index.d.ts, documenting thatcdf( 2.0, 0.0, -1.0 )returnsNaN. The case is already covered by thesigma <= 0.0guard, theREADME.md, anddocs/repl.txt— the omission was a JSDoc/TypeScript oversight, not intentional. Bringscdfinto conformance with the four sibling lognormal packages (pdf,logpdf,logcdf,quantile) that already carry this block.Validation
Checked:
package.jsonshape, README section list,manifest.jsonshape, test/benchmark/example filenames) across all 14 members.sonnetagents readinglib/main.js,lib/index.js,lib/factory.js, andlib/validate.jsdirectly.opussemantic-review confirmed the missing@exampleblock is unintentional drift, given identicalsigma <= 0.0validation and existing README/REPL coverage of the same case.opuscross-reference confirmedtest/test.cdf.jsalready coverscdf( x, mu, -1.0 ) === NaN(lines 75–79), no test or example inspects JSDoc text, and no sibling-package documentation references would be affected.sonnetstructural-review confirmed the addition mirrors the canonical pattern inpdf,logpdf,logcdf, andquantile, and that placement in bothlib/main.jsand theinterface CDFmain-signature JSDoc is correct.Deliberately excluded:
ctorerrorConstruction = "format"andvalidationPrologueusingisPositive/isNumber(vs. theisnan || ... || sigma <= 0.0majority). Intentional deviation: a class constructor legitimately throwsTypeErroron bad arguments rather than returningNaN; semantic shape is genuinely different.logcdfJSDoc typessigmaasNonNegativeNumber(vs. 13/14PositiveNumber) and lacks the canonical validation prologue. Intentional deviation: the function delegates to@stdlib/stats/base/dists/normal/logcdfafterln(x)transformation, which handlessigma === 0as a degenerate distribution returning-Infinity(documented in the JSDoc andrepl.txt); narrowing toPositiveNumberwould misrepresent supported behavior.stdevlacks the canonical validation prologue, delegatingreturn sqrt( variance( mu, sigma ) );. Intentional deviation:variancealready performs identical validation;sqrt(NaN) === NaNpreserves observable behavior;binomial/stdev,poisson/stdev,pareto-type1/stdevfollow the same delegating idiom.cdf,ctor,logcdf,logpdf) reflect a deliberate JS-only subset, not drift; adding C bindings is a substantive new feature handled in separate PRs (e.g. feat: add C implementation for stats/base/dists/lognormal/cdf #10883, feat: add C implementation forstats/base/dists/lognormal/cdf#10809, feat: add C implementation for stats/base/dists/lognormal/logcdf #10882).cdfusesnegative_mean.json/positive_mean.json;pdf/quantile/logpdfusenegative_location.json/positive_location.json;logcdfuses R fixtures rather than Julia). Cascading change: would require regenerating fixture data and editingrunner.jl/runner.R; out of scope for mechanical drift correction.## See AlsoREADME section drift — auto-populated by the package generator; gate 7a excludes.Related Issues
No.
Questions
No.
Other
Random namespace pick from the
lib/node_modules/@stdlib/walk of directories with ≥8 direct child packages. Does not conflict with the open native-binding PRs targeting the same package (#10883, #10809), which touch onlylib/native.js,src/**,binding.gyp,manifest.json,include.gypi,benchmark/benchmark.native.js,test/test.native.js, and the## C APIsREADME section — orthogonal to the JSDoc and TypeScript-declaration files modified here.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code via the cross-package drift-detection routine: structural and semantic features were extracted from every member of
stats/base/dists/lognormal, majority patterns were computed at a 75% conformance threshold, and three independent validation agents (opussemantic-review,opuscross-reference,sonnetstructural-review) confirmed the surviving correction was high-signal mechanical drift before any file was edited. The single edit is purely additive JSDoc + TypeScript-declaration documentation; no source, test, or behavioral changes.@stdlib-js/reviewers
Generated by Claude Code