refactor: use main in bernoulli/{mean,median,mode}/lib/index.js#13156
Open
Planeshifter wants to merge 3 commits into
Open
refactor: use main in bernoulli/{mean,median,mode}/lib/index.js#13156Planeshifter wants to merge 3 commits into
main in bernoulli/{mean,median,mode}/lib/index.js#13156Planeshifter wants to merge 3 commits into
Conversation
…s/base/dists/bernoulli/mean` Renames the `lib/index.js` local-variable holding the `require( './main.js' )` result from `mean` to `main`, aligning with the namespace majority pattern (10/13 = 77% of `@stdlib/stats/base/dists/bernoulli` members; 412/507 = 81% of `@stdlib/stats/base/dists` overall). Purely internal rename; the module's exported value, signature, and JSDoc are unchanged.
…s/base/dists/bernoulli/median` Renames the `lib/index.js` local-variable holding the `require( './main.js' )` result from `median` to `main`, aligning with the namespace majority pattern (10/13 = 77% of `@stdlib/stats/base/dists/bernoulli` members; 412/507 = 81% of `@stdlib/stats/base/dists` overall). Purely internal rename; the module's exported value, signature, and JSDoc are unchanged.
…s/base/dists/bernoulli/mode` Renames the `lib/index.js` local-variable holding the `require( './main.js' )` result from `mode` to `main`, aligning with the namespace majority pattern (10/13 = 77% of `@stdlib/stats/base/dists/bernoulli` members; 412/507 = 81% of `@stdlib/stats/base/dists` overall). Purely internal rename; the module's exported value, signature, and JSDoc are unchanged.
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.
Description
This pull request renames the
lib/index.jslocal variable that holds therequire( './main.js' )result from the function name tomainin three outlier packages under@stdlib/stats/base/dists/bernoulli. Purely internal rename; no source, signature, JSDoc, test, or behavioral change.Namespace summary
@stdlib/stats/base/dists/bernoullicdf,ctor,entropy,kurtosis,mean,median,mgf,mode,pmf,quantile,skewness,stdev,variance)ctor, which is a constructor class and legitimately omits the native-binding cluster),package.jsontop-level shape,directories,manifest.jsonkeys (confs/fields/options),binding.gyp/include.gypi/src/main.c/src/addon.c/lib/native.js/examples/c//benchmark/c/presence, the 10 shared keywords (stdlib,stdmath,statistics,stats,distribution,dist,bernoulli,binomial,discrete,univariate), README## Usage/## Examples/## C APIs/### Usage/### Examplessection sequence,lib/main.jsvalidation prologue (isnan(p) || p < 0.0 || p > 1.0 → NaN),lib/main.jserror construction (no errors thrown — all surface invalid input asNaN), JSDoc@param {Probability} p - success probabilityconvention, and thevar main = require( './main.js' )lib/index.jsentry-point convention (10/13 = 77% within bernoulli; 412/507 = 81% across@stdlib/stats/base/dists).lib/factory.jspresence (4/13, tracks whether the function takes a non-distribution argument —cdf,mgf,pmf,quantile);test/fixtures/julia/data.json(7/13, only the closed-form summary stats carry it);## NotesREADME section (1/13 —mode/README.mdhas it becausep = 0.5legitimately needs a tie-break note);factory.jsvalidation-prologue style (2 single-line vs. 2 stacked, no majority either way);'parameter'keyword (8/13, tracks the summary-stat sub-cluster). Surfaced but intentionally deviating:ctor(constructor class, no native binding);stdev(delegates validation tovariance; uses Python fixtures instead of Julia — porting the reference data is not mechanical and is out of scope).@stdlib/stats/base/dists/bernoulli/meanRenames the
lib/index.jslocal-variable holdingrequire( './main.js' )frommeantomainto match the namespace majority (10/13 = 77%) and the wider ecosystem (412/507 = 81% across@stdlib/stats/base/dists). Themodule.exportsreference is updated correspondingly. JSDoc@exampleblock — which intentionally usesvar mean = require( '@stdlib/stats/base/dists/bernoulli/mean' );to model consumer code — is left untouched.@stdlib/stats/base/dists/bernoulli/medianSame rename, applied to
lib/index.jsof@stdlib/stats/base/dists/bernoulli/median. The variable inMODULESand the value passed tomodule.exportsswitch frommediantomain; the JSDoc@exampleblock keeps the consumer-facingvar median = require( '@stdlib/stats/base/dists/bernoulli/median' );form.@stdlib/stats/base/dists/bernoulli/modeSame rename, applied to
lib/index.jsof@stdlib/stats/base/dists/bernoulli/mode. Variable inMODULESandmodule.exportsswitch frommodetomain; consumer-facing@exampleblock is untouched.Related Issues
No.
Questions
No.
Other
Validation
Checked:
package.jsonshape (top-level keys,scripts,directories,keywords,stdlib),manifest.jsonkeys, README##/###heading set and sequence,lib/,src/,test/,benchmark/,examples/,docs/,binding.gyp,include.gypi, Makefile EOF conventions.lib/main.js,lib/index.js, andlib/factory.js(where present) files: public signature, return kind, validation prologue, error construction style, JSDoc tag set,require()-derived dependencies. Performed by direct file inspection rather than per-package agents — the namespace has 13 members and everylib/main.jsfollows the sameisnan(p) || p < 0.0 || p > 1.0 → NaNprologue with no thrown errors, so the agent layer would not surface additional drift.lib/index.jsvariable name is a purely structural feature; Agent 1 (semantic-review) skipped per policy. Agent 2 (cross-reference): tests import viarequire( './../lib' )and consume onlymodule.exports; no test, example, or sibling package code references the local variable name. Agent 3 (structural-review): confirmedmainas the convention via 77% within-namespace and 81% wider-stats/base/distsconformance.is:open bernoulli) and PRs merged in the last 14 days (is:merged bernoulli merged:>2026-06-13); none touch the threelib/index.jsfiles modified here.Deliberately excluded:
ctor's missing native-binding cluster (binding.gyp,src/,include/,manifest.json,lib/native.js,examples/c/,benchmark/c/,test/test.native.js,## C APIsREADME section).ctoris the distribution constructor class, not a math function; it has no C analog. Intentional deviation, not drift.stdev's Python vs. Julia test fixtures. All 11 other summary-stat packages usetest/fixtures/julia/;stdevusestest/fixtures/python/. Porting the reference data requires re-generating it via Julia and rewriting the test loader — not a mechanical edit. Flagged for a future routine.stdev's missing validation prologue.stdev/lib/main.jsissqrt( variance( p ) )and inherits NaN propagation fromvariance. Intentional delegation, not drift.lib/factory.jspresence (4/13). Tracks whether the function takes a non-distribution argument (cdf,mgf,pmf,quantile); not a drift-correctable feature.mode's## NotesREADME section.mode(0.5)is a legitimate tie between0and1; the implementation returns0and the note documents that. Intentional content, not drift.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. The target namespace
@stdlib/stats/base/dists/bernoulliwas selected by uniform-random pick over the 123 eligible directories (≥8 direct child packages withpackage.jsonunderlib/node_modules/@stdlib/). Structural and semantic features were extracted from all 13 members, majority patterns were computed at the 75% conformance threshold, and the surviving correction was validated against the namespace, the widerstats/base/distsecosystem, and open/recent PRs before any file was edited. Each rename is a two-line in-file substitution; no source behavior, JSDoc, test, or generator output is touched.@stdlib-js/reviewers
Generated by Claude Code