Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ml-savitzky-golay-generalized

Package Overview
Dependencies
Maintainers
7
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-savitzky-golay-generalized - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

9

History.md

@@ -0,1 +1,10 @@

## [2.0.2](https://github.com/mljs/savitzky-golay-generalized/compare/v2.0.1...v2.0.2) (2020-04-13)
### Bug Fixes
* fix calculation of right-hand-side border ([06efae8](https://github.com/mljs/savitzky-golay-generalized/commit/06efae8b31439ba1590e69ea73c345d8d4e563a4))
## [2.0.1](https://github.com/mljs/savitzky-golay-generalized/compare/v2.0.0...v2.0.1) (2020-02-28)

@@ -2,0 +11,0 @@

2

lib/index.js

@@ -50,3 +50,3 @@ 'use strict';

d1 += wg1[l] * data[l];
d2 += wg2[l] * data[np - windowSize + l - 1];
d2 += wg2[l] * data[np - windowSize + l];
}

@@ -53,0 +53,0 @@ if (constantH) {

{
"name": "ml-savitzky-golay-generalized",
"version": "2.0.1",
"version": "2.0.2",
"description": "Savitzky–Golay filter in Javascript",

@@ -41,14 +41,14 @@ "main": "lib/index.js",

"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
"@types/jest": "^25.1.3",
"@babel/plugin-transform-modules-commonjs": "^7.9.0",
"@types/jest": "^25.2.1",
"eslint": "^6.8.0",
"eslint-config-cheminfo": "^2.0.4",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.8.0",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^25.1.0",
"prettier": "^1.19.1",
"rollup": "^1.31.1"
"eslint-config-cheminfo": "^3.0.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-prettier": "^3.1.3",
"jest": "^25.3.0",
"prettier": "^2.0.4",
"rollup": "^2.6.1"
},
"dependencies": {}
}

@@ -84,2 +84,19 @@ import SG from '..';

});
it('Border test', () => {
let options = {
windowSize: 9,
derivative: 1,
polynomial: 3,
};
let data = new Array(20);
for (let i = 0; i < data.length; i++) {
data[i] = Math.pow(i, 3) - 4 * Math.pow(i, 2) + 5 * i;
}
let ans = SG(data, 1, options);
for (let j = 0; j < data.length; j++) {
expect(ans[j]).toBeCloseTo(3 * Math.pow(j, 2) - 8 * j + 5, 6);
}
});
});

@@ -48,3 +48,3 @@ export default function SavitzkyGolay(data, h, options = {}) {

d1 += wg1[l] * data[l];
d2 += wg2[l] * data[np - windowSize + l - 1];
d2 += wg2[l] * data[np - windowSize + l];
}

@@ -51,0 +51,0 @@ if (constantH) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc