From 252ce66faa6e0687ca5456928a703962afa4538f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 19 Aug 2023 18:00:46 +0000 Subject: [PATCH] Auto-generated commit --- .github/.keepalive | 1 - .github/workflows/productionize.yml | 15 --------------- dist/index.d.ts | 3 +++ dist/index.js | 5 +++++ dist/index.js.map | 7 +++++++ docs/types/index.d.ts | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 .github/.keepalive create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index c054fcb..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T03:45:56.938Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 334eb59..91f2b93 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -82,21 +82,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - name: 'Update dependencies in package.json' run: | diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..5cc3a7e --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import incrmvmr from '../docs/types/index'; +export = incrmvmr; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..03236d7 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5 @@ +"use strict";var w=function(a,l){return function(){return l||a((l={exports:{}}).exports,l),l.exports}};var b=w(function(T,d){ +var k=require('@stdlib/assert-is-positive-integer/dist').isPrimitive,y=require('@stdlib/assert-is-number/dist').isPrimitive,v=require('@stdlib/math-base-assert-is-nan/dist'),p=require('@stdlib/error-tools-fmtprodmsg/dist');function M(a,l){var u,f,o,e,r,c,g,i,m,n;if(!k(a))throw new TypeError(p('1JL8B',a));if(f=new Array(a),m=a-1,e=0,n=-1,i=0,arguments.length>1){if(!y(l))throw new TypeError(p('1JL9X',l));return r=l,q}return r=0,h;function h(t){var s,N;if(arguments.length===0)return i===0?null:i===1?v(e)?NaN:0/r:i 1 ) {\n\t\tif ( !isNumber( mean ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a number. Value: `%s`.', mean ) );\n\t\t}\n\t\tmu = mean;\n\t\treturn accumulator2;\n\t}\n\tmu = 0.0;\n\treturn accumulator1;\n\n\t/**\n\t* If provided a value, the accumulator function returns an updated accumulated value. If not provided a value, the accumulator function returns the current accumulated value.\n\t*\n\t* @private\n\t* @param {number} [x] - input value\n\t* @returns {(number|null)} accumulated value or null\n\t*/\n\tfunction accumulator1( x ) {\n\t\tvar k;\n\t\tvar v;\n\t\tif ( arguments.length === 0 ) {\n\t\t\tif ( N === 0 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( N === 1 ) {\n\t\t\t\treturn ( isnan( M2 ) ) ? NaN : 0.0/mu;\n\t\t\t}\n\t\t\tif ( N < W ) {\n\t\t\t\treturn ( M2/(N-1) ) / mu;\n\t\t\t}\n\t\t\treturn ( M2/n ) / mu;\n\t\t}\n\t\t// Update the index for managing the circular buffer:\n\t\ti = (i+1) % W;\n\n\t\t// Case: incoming value is NaN, the sliding second moment is automatically NaN...\n\t\tif ( isnan( x ) ) {\n\t\t\tN = W; // explicitly set to avoid `N < W` branch\n\t\t\tmu = NaN;\n\t\t\tM2 = NaN;\n\t\t}\n\t\t// Case: initial window...\n\t\telse if ( N < W ) {\n\t\t\tbuf[ i ] = x; // update buffer\n\t\t\tN += 1;\n\t\t\tdelta = x - mu;\n\t\t\tmu += delta / N;\n\t\t\tM2 += delta * (x - mu);\n\t\t\tif ( N === 1 ) {\n\t\t\t\treturn 0.0 / mu;\n\t\t\t}\n\t\t\treturn ( M2/(N-1) ) / mu;\n\t\t}\n\t\t// Case: N = W = 1\n\t\telse if ( N === 1 ) {\n\t\t\tmu = x;\n\t\t\tM2 = 0.0;\n\t\t\treturn M2 / mu;\n\t\t}\n\t\t// Case: outgoing value is NaN, and, thus, we need to compute the accumulated values...\n\t\telse if ( isnan( buf[ i ] ) ) {\n\t\t\tN = 1;\n\t\t\tmu = x;\n\t\t\tM2 = 0.0;\n\t\t\tfor ( k = 0; k < W; k++ ) {\n\t\t\t\tif ( k !== i ) {\n\t\t\t\t\tv = buf[ k ];\n\t\t\t\t\tif ( isnan( v ) ) {\n\t\t\t\t\t\tN = W; // explicitly set to avoid `N < W` branch\n\t\t\t\t\t\tmu = NaN;\n\t\t\t\t\t\tM2 = NaN;\n\t\t\t\t\t\tbreak; // second moment is automatically NaN, so no need to continue\n\t\t\t\t\t}\n\t\t\t\t\tN += 1;\n\t\t\t\t\tdelta = v - mu;\n\t\t\t\t\tmu += delta / N;\n\t\t\t\t\tM2 += delta * (v - mu);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Case: neither the current second moment nor the incoming value are NaN, so we need to update the accumulated values...\n\t\telse if ( isnan( M2 ) === false ) {\n\t\t\ttmp = buf[ i ];\n\t\t\tdelta = x - tmp;\n\t\t\td1 = tmp - mu;\n\t\t\tmu += delta / W;\n\t\t\td2 = x - mu;\n\t\t\tM2 += delta * (d1 + d2);\n\t\t}\n\t\t// Case: the current second moment is NaN, so nothing to do until the buffer no longer contains NaN values...\n\t\tbuf[ i ] = x;\n\n\t\treturn ( M2/n ) / mu;\n\t}\n\n\t/**\n\t* If provided a value, the accumulator function returns an updated accumulated value. If not provided a value, the accumulator function returns the current accumulated value.\n\t*\n\t* @private\n\t* @param {number} [x] - input value\n\t* @returns {(number|null)} accumulated value or null\n\t*/\n\tfunction accumulator2( x ) {\n\t\tvar k;\n\t\tif ( arguments.length === 0 ) {\n\t\t\tif ( N === 0 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( N < W ) {\n\t\t\t\treturn ( M2/N ) / mu;\n\t\t\t}\n\t\t\treturn ( M2/W ) / mu;\n\t\t}\n\t\t// Update the index for managing the circular buffer:\n\t\ti = (i+1) % W;\n\n\t\t// Case: incoming value is NaN, the sliding second moment is automatically NaN...\n\t\tif ( isnan( x ) ) {\n\t\t\tN = W; // explicitly set to avoid `N < W` branch\n\t\t\tM2 = NaN;\n\t\t}\n\t\t// Case: initial window...\n\t\telse if ( N < W ) {\n\t\t\tbuf[ i ] = x; // update buffer\n\t\t\tN += 1;\n\t\t\tdelta = x - mu;\n\t\t\tM2 += delta * delta;\n\t\t\treturn ( M2/N ) / mu;\n\t\t}\n\t\t// Case: outgoing value is NaN, and, thus, we need to compute the accumulated values...\n\t\telse if ( isnan( buf[ i ] ) ) {\n\t\t\tM2 = 0.0;\n\t\t\tfor ( k = 0; k < W; k++ ) {\n\t\t\t\tif ( k !== i ) {\n\t\t\t\t\tif ( isnan( buf[ k ] ) ) {\n\t\t\t\t\t\tN = W; // explicitly set to avoid `N < W` branch\n\t\t\t\t\t\tM2 = NaN;\n\t\t\t\t\t\tbreak; // second moment is automatically NaN, so no need to continue\n\t\t\t\t\t}\n\t\t\t\t\tdelta = buf[ k ] - mu;\n\t\t\t\t\tM2 += delta * delta;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Case: neither the current second moment nor the incoming value are NaN, so we need to update the accumulated values...\n\t\telse if ( isnan( M2 ) === false ) {\n\t\t\ttmp = buf[ i ];\n\t\t\tM2 += ( x-tmp ) * ( x-mu + tmp-mu );\n\t\t}\n\t\t// Case: the current second moment is NaN, so nothing to do until the buffer no longer contains NaN values...\n\t\tbuf[ i ] = x;\n\n\t\treturn ( M2/W ) / mu;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = incrmvmr;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute a moving variance-to-mean ratio (VMR) incrementally.\n*\n* @module @stdlib/stats-incr-mvmr\n*\n* @example\n* var incrmvmr = require( '@stdlib/stats-incr-mvmr' );\n*\n* var accumulator = incrmvmr( 3 );\n*\n* var F = accumulator();\n* // returns null\n*\n* F = accumulator( 2.0 );\n* // returns 0.0\n*\n* F = accumulator( 1.0 );\n* // returns ~0.33\n*\n* F = accumulator( 3.0 );\n* // returns 0.5\n*\n* F = accumulator( 7.0 );\n* // returns ~2.55\n*\n* F = accumulator();\n* // returns ~2.55\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,oCAAqC,EAAE,YACpEC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAQ,QAAS,iCAAkC,EACnDC,EAAS,QAAS,uBAAwB,EAyG9C,SAASC,EAAUC,EAAGC,EAAO,CAC5B,IAAIC,EACAC,EACAC,EACAC,EACA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A,GAAMJ,EAAQO,EACdJ,GAAMH,GAASc,EAAIV,EACpB,OAIQT,EAAOQ,CAAG,IAAM,KACzBD,EAAMD,EAAKQ,CAAE,EACbT,EAAQY,EAAIV,EACZG,EAAKH,EAAME,EACXA,GAAMJ,EAAQF,EACdQ,EAAKM,EAAIR,EACTD,GAAMH,GAASK,EAAKC,IAGrB,OAAAL,EAAKQ,CAAE,EAAIG,EAEFT,EAAGK,EAAMJ,CACnB,CASA,SAASM,EAAcE,EAAI,CAC1B,IAAIC,EACJ,GAAK,UAAU,SAAW,EACzB,OAAKN,IAAM,EACH,KAEHA,EAAIT,EACCK,EAAGI,EAAMH,EAEVD,EAAGL,EAAMM,EAMnB,GAHAK,GAAKA,EAAE,GAAKX,EAGPH,EAAOiB,CAAE,EACbL,EAAIT,EACJK,EAAK,QAGD,IAAKI,EAAIT,EACb,OAAAG,EAAKQ,CAAE,EAAIG,EACXL,GAAK,EACLP,EAAQY,EAAIR,EACZD,GAAMH,EAAQA,EACLG,EAAGI,EAAMH,EAGd,GAAKT,EAAOM,EAAKQ,CAAE,CAAE,GAEzB,IADAN,EAAK,EACCU,EAAI,EAAGA,EAAIf,EAAGe,IACnB,GAAKA,IAAMJ,EAAI,CACd,GAAKd,EAAOM,EAAKY,CAAE,CAAE,EAAI,CACxBN,EAAIT,EACJK,EAAK,IACL,KACD,CACAH,EAAQC,EAAKY,CAAE,EAAIT,EACnBD,GAAMH,EAAQA,CACf,OAIQL,EAAOQ,CAAG,IAAM,KACzBD,EAAMD,EAAKQ,CAAE,EACbN,IAAQS,EAAEV,IAAUU,EAAER,EAAKF,EAAIE,IAGhC,OAAAH,EAAKQ,CAAE,EAAIG,EAEFT,EAAGL,EAAMM,CACnB,CACD,CAKAZ,EAAO,QAAUK,ICjQjB,IAAIkB,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_main", "__commonJSMin", "exports", "module", "isPositiveInteger", "isNumber", "isnan", "format", "incrmvmr", "W", "mean", "delta", "buf", "tmp", "M2", "mu", "d1", "d2", "N", "n", "i", "accumulator2", "accumulator1", "x", "k", "v", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index f7c26bc..fdd7115 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 ///