From 6236d07b1946fe006b74174c97309b9ead270d93 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sat, 6 Jun 2026 00:06:14 -0500 Subject: [PATCH] refactor: align stream constructor parameter names with documentation in random/streams The `RandomStream` constructor, callable/newable, `factory`, and `objectMode` signatures named their distribution parameter `p` (or `k` for the Student's t distribution), diverging from the `@param`/`@throws` TSDoc and the implementation, which use the distribution-appropriate names: - exponential: `p` -> `lambda` (rate parameter) - poisson: `p` -> `lambda` (mean) - rayleigh: `p` -> `sigma` (scale parameter) - chisquare: `p` -> `k` (degrees of freedom) - t: `k` -> `v` (degrees of freedom) Parameter names in ambient declarations are documentation only and do not affect type-checking, so this is a non-behavioral refactor that makes the signatures self-consistent with their TSDoc and the runtime implementation. --- .../random/streams/chisquare/docs/types/index.d.ts | 12 ++++++------ .../random/streams/exponential/docs/types/index.d.ts | 12 ++++++------ .../random/streams/poisson/docs/types/index.d.ts | 12 ++++++------ .../random/streams/rayleigh/docs/types/index.d.ts | 12 ++++++------ .../@stdlib/random/streams/t/docs/types/index.d.ts | 12 ++++++------ 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/node_modules/@stdlib/random/streams/chisquare/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/streams/chisquare/docs/types/index.d.ts index 878375800f22..2b1bed155210 100644 --- a/lib/node_modules/@stdlib/random/streams/chisquare/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/random/streams/chisquare/docs/types/index.d.ts @@ -108,7 +108,7 @@ declare class RandomStream extends Readable { * * stream.pipe( inspectStream( log ) ); */ - constructor( p: number, options?: Options ); + constructor( k: number, options?: Options ); /** * Destruction state. @@ -227,7 +227,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - new( p: number, options?: Options ): RandomStream; // newable + new( k: number, options?: Options ): RandomStream; // newable /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from a chi-square distribution. @@ -254,7 +254,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - ( p: number, options?: Options ): RandomStream; // callable + ( k: number, options?: Options ): RandomStream; // callable /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution. @@ -281,7 +281,7 @@ interface Constructor { * streams.push( createStream() ); * } */ - factory( p: number, options?: Options ): ( ...args: Array ) => RandomStream; + factory( k: number, options?: Options ): ( ...args: Array ) => RandomStream; /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution. @@ -306,7 +306,7 @@ interface Constructor { * streams.push( createStream( 0.7 ) ); * } */ - factory( options?: Options ): ( p: number ) => RandomStream; + factory( options?: Options ): ( k: number ) => RandomStream; /** * Returns an "objectMode" readable stream for generating a stream of pseudorandom numbers drawn from a chi-square distribution. @@ -333,7 +333,7 @@ interface Constructor { * * stream.pipe( inspectStream.objectMode( log ) ); */ - objectMode( p: number, options?: Options ): RandomStream; + objectMode( k: number, options?: Options ): RandomStream; } /** diff --git a/lib/node_modules/@stdlib/random/streams/exponential/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/streams/exponential/docs/types/index.d.ts index 5b2e44bca608..22bf59cb4780 100644 --- a/lib/node_modules/@stdlib/random/streams/exponential/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/random/streams/exponential/docs/types/index.d.ts @@ -108,7 +108,7 @@ declare class RandomStream extends Readable { * * stream.pipe( inspectStream( log ) ); */ - constructor( p: number, options?: Options ); + constructor( lambda: number, options?: Options ); /** * Destruction state. @@ -227,7 +227,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - new( p: number, options?: Options ): RandomStream; // newable + new( lambda: number, options?: Options ): RandomStream; // newable /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from an exponential distribution. @@ -254,7 +254,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - ( p: number, options?: Options ): RandomStream; // callable + ( lambda: number, options?: Options ): RandomStream; // callable /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution. @@ -281,7 +281,7 @@ interface Constructor { * streams.push( createStream() ); * } */ - factory( p: number, options?: Options ): ( ...args: Array ) => RandomStream; + factory( lambda: number, options?: Options ): ( ...args: Array ) => RandomStream; /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution. @@ -306,7 +306,7 @@ interface Constructor { * streams.push( createStream( 0.7 ) ); * } */ - factory( options?: Options ): ( p: number ) => RandomStream; + factory( options?: Options ): ( lambda: number ) => RandomStream; /** * Returns an "objectMode" readable stream for generating a stream of pseudorandom numbers drawn from an exponential distribution. @@ -333,7 +333,7 @@ interface Constructor { * * stream.pipe( inspectStream.objectMode( log ) ); */ - objectMode( p: number, options?: Options ): RandomStream; + objectMode( lambda: number, options?: Options ): RandomStream; } /** diff --git a/lib/node_modules/@stdlib/random/streams/poisson/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/streams/poisson/docs/types/index.d.ts index 1a5239cc5dd8..248e2f31ef8e 100644 --- a/lib/node_modules/@stdlib/random/streams/poisson/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/random/streams/poisson/docs/types/index.d.ts @@ -108,7 +108,7 @@ declare class RandomStream extends Readable { * * stream.pipe( inspectStream( log ) ); */ - constructor( p: number, options?: Options ); + constructor( lambda: number, options?: Options ); /** * Destruction state. @@ -227,7 +227,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - new( p: number, options?: Options ): RandomStream; // newable + new( lambda: number, options?: Options ): RandomStream; // newable /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from a Poisson distribution. @@ -254,7 +254,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - ( p: number, options?: Options ): RandomStream; // callable + ( lambda: number, options?: Options ): RandomStream; // callable /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution. @@ -281,7 +281,7 @@ interface Constructor { * streams.push( createStream() ); * } */ - factory( p: number, options?: Options ): ( ...args: Array ) => RandomStream; + factory( lambda: number, options?: Options ): ( ...args: Array ) => RandomStream; /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution. @@ -306,7 +306,7 @@ interface Constructor { * streams.push( createStream( 0.7 ) ); * } */ - factory( options?: Options ): ( p: number ) => RandomStream; + factory( options?: Options ): ( lambda: number ) => RandomStream; /** * Returns an "objectMode" readable stream for generating a stream of pseudorandom numbers drawn from a Poisson distribution. @@ -333,7 +333,7 @@ interface Constructor { * * stream.pipe( inspectStream.objectMode( log ) ); */ - objectMode( p: number, options?: Options ): RandomStream; + objectMode( lambda: number, options?: Options ): RandomStream; } /** diff --git a/lib/node_modules/@stdlib/random/streams/rayleigh/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/streams/rayleigh/docs/types/index.d.ts index 55a961bb3961..b9e2afe3cf1f 100644 --- a/lib/node_modules/@stdlib/random/streams/rayleigh/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/random/streams/rayleigh/docs/types/index.d.ts @@ -108,7 +108,7 @@ declare class RandomStream extends Readable { * * stream.pipe( inspectStream( log ) ); */ - constructor( p: number, options?: Options ); + constructor( sigma: number, options?: Options ); /** * Destruction state. @@ -227,7 +227,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - new( p: number, options?: Options ): RandomStream; // newable + new( sigma: number, options?: Options ): RandomStream; // newable /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution. @@ -254,7 +254,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - ( p: number, options?: Options ): RandomStream; // callable + ( sigma: number, options?: Options ): RandomStream; // callable /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution. @@ -281,7 +281,7 @@ interface Constructor { * streams.push( createStream() ); * } */ - factory( p: number, options?: Options ): ( ...args: Array ) => RandomStream; + factory( sigma: number, options?: Options ): ( ...args: Array ) => RandomStream; /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution. @@ -306,7 +306,7 @@ interface Constructor { * streams.push( createStream( 0.7 ) ); * } */ - factory( options?: Options ): ( p: number ) => RandomStream; + factory( options?: Options ): ( sigma: number ) => RandomStream; /** * Returns an "objectMode" readable stream for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution. @@ -333,7 +333,7 @@ interface Constructor { * * stream.pipe( inspectStream.objectMode( log ) ); */ - objectMode( p: number, options?: Options ): RandomStream; + objectMode( sigma: number, options?: Options ): RandomStream; } /** diff --git a/lib/node_modules/@stdlib/random/streams/t/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/streams/t/docs/types/index.d.ts index 81b625a4bfdd..71b4db7adff4 100644 --- a/lib/node_modules/@stdlib/random/streams/t/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/random/streams/t/docs/types/index.d.ts @@ -108,7 +108,7 @@ declare class RandomStream extends Readable { * * stream.pipe( inspectStream( log ) ); */ - constructor( k: number, options?: Options ); + constructor( v: number, options?: Options ); /** * Destruction state. @@ -227,7 +227,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - new( k: number, options?: Options ): RandomStream; // newable + new( v: number, options?: Options ): RandomStream; // newable /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from a Student's t distribution. @@ -254,7 +254,7 @@ interface Constructor { * * stream.pipe( inspectStream( log ) ); */ - ( k: number, options?: Options ): RandomStream; // callable + ( v: number, options?: Options ): RandomStream; // callable /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution. @@ -281,7 +281,7 @@ interface Constructor { * streams.push( createStream() ); * } */ - factory( k: number, options?: Options ): ( ...args: Array ) => RandomStream; + factory( v: number, options?: Options ): ( ...args: Array ) => RandomStream; /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution. @@ -306,7 +306,7 @@ interface Constructor { * streams.push( createStream( 2.0 ) ); * } */ - factory( options?: Options ): ( k: number ) => RandomStream; + factory( options?: Options ): ( v: number ) => RandomStream; /** * Returns an "objectMode" readable stream for generating a stream of pseudorandom numbers drawn from a Student's t distribution. @@ -333,7 +333,7 @@ interface Constructor { * * stream.pipe( inspectStream.objectMode( log ) ); */ - objectMode( k: number, options?: Options ): RandomStream; + objectMode( v: number, options?: Options ): RandomStream; } /**