From 60a2e5383f76900dce485b4a6ec294a98d9c62c9 Mon Sep 17 00:00:00 2001 From: impawstarlight Date: Sun, 30 Mar 2025 23:16:54 +0600 Subject: [PATCH 1/2] fix: resolve lint errors in `random/base/minstd` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../random/base/minstd/docs/types/test.ts | 2 +- .../@stdlib/random/base/minstd/lib/main.js | 3 - .../@stdlib/random/base/minstd/manifest.json | 76 +++++++++---------- .../random/base/minstd/test/test.factory.js | 2 +- 4 files changed, 40 insertions(+), 43 deletions(-) diff --git a/lib/node_modules/@stdlib/random/base/minstd/docs/types/test.ts b/lib/node_modules/@stdlib/random/base/minstd/docs/types/test.ts index e95028edfd4c..860129c751ba 100644 --- a/lib/node_modules/@stdlib/random/base/minstd/docs/types/test.ts +++ b/lib/node_modules/@stdlib/random/base/minstd/docs/types/test.ts @@ -86,7 +86,7 @@ import minstd = require( './index' ); minstd.factory( { 'state': null } ); // $ExpectError minstd.factory( { 'state': [] } ); // $ExpectError minstd.factory( { 'state': {} } ); // $ExpectError - minstd.factory( { 'state': true ); // $ExpectError + minstd.factory( { 'state': true } ); // $ExpectError minstd.factory( { 'state': ( x: number ): number => x } ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/random/base/minstd/lib/main.js b/lib/node_modules/@stdlib/random/base/minstd/lib/main.js index 65343b4da150..f31a9faaa960 100644 --- a/lib/node_modules/@stdlib/random/base/minstd/lib/main.js +++ b/lib/node_modules/@stdlib/random/base/minstd/lib/main.js @@ -75,18 +75,15 @@ var randint32 = require( './rand_int32.js' ); * * The values for \\( a \\), \\( c \\), and \\( m \\) are taken from Park and Miller, "Random Number Generators: Good Ones Are Hard To Find". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_. * -* * ## Notes * * - The generator has a period of approximately \\(2.1\mbox{e}9\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279). * -* * ## References * * - Park, S. K., and K. W. Miller. 1988. "Random Number Generators: Good Ones Are Hard to Find." _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192–1201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042). * - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press. * -* * @function minstd * @type {PRNG} * @returns {PositiveInteger} pseudorandom integer diff --git a/lib/node_modules/@stdlib/random/base/minstd/manifest.json b/lib/node_modules/@stdlib/random/base/minstd/manifest.json index 71374c75d7e3..e91236537092 100644 --- a/lib/node_modules/@stdlib/random/base/minstd/manifest.json +++ b/lib/node_modules/@stdlib/random/base/minstd/manifest.json @@ -1,40 +1,40 @@ { - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/random/base/shared" - ] - } - ] + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/random/base/shared" + ] + } + ] } diff --git a/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js b/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js index b972e24f864b..69898110a1ef 100644 --- a/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js +++ b/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js @@ -1094,7 +1094,7 @@ tape( 'the `normalized` method returns pseudorandom numbers drawn from a uniform threshold = 0.10; - x = new Array( 1e3 ); + x = new Array( 1e3 ); // eslint-disable-line stdlib/no-new-array N = 500; count = -1; From aa498d372cb91b46bf6ecca656c766e413b7c41b Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 1 Apr 2025 18:14:23 -0700 Subject: [PATCH 2/2] test: refactor to use base array utility for allocation Signed-off-by: Athan --- .../@stdlib/random/base/minstd/test/test.factory.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js b/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js index 69898110a1ef..33b65638c5e9 100644 --- a/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js +++ b/lib/node_modules/@stdlib/random/base/minstd/test/test.factory.js @@ -32,6 +32,7 @@ var Int32Array = require( '@stdlib/array/int32' ); var kstest = require( '@stdlib/stats/kstest' ); var gcopy = require( '@stdlib/blas/base/gcopy' ); var typedarray2json = require( '@stdlib/array/to-json' ); +var zeros = require( '@stdlib/array/base/zeros' ); var factory = require( './../lib/factory.js' ); @@ -1094,7 +1095,7 @@ tape( 'the `normalized` method returns pseudorandom numbers drawn from a uniform threshold = 0.10; - x = new Array( 1e3 ); // eslint-disable-line stdlib/no-new-array + x = zeros( 1e3 ); N = 500; count = -1;