spectrum-generator
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -0,1 +1,10 @@ | ||
## [4.0.2](https://github.com/cheminfo/spectrum-generator/compare/v4.0.1...v4.0.2) (2020-04-18) | ||
### Bug Fixes | ||
* one more edge bug that leads to y=0 ([8bbca0f](https://github.com/cheminfo/spectrum-generator/commit/8bbca0fe8659290e15d413b6a8f2b28d071dd877)) | ||
## [4.0.1](https://github.com/cheminfo/spectrum-generator/compare/v4.0.0...v4.0.1) (2020-04-18) | ||
@@ -2,0 +11,0 @@ |
@@ -167,3 +167,3 @@ 'use strict'; | ||
); | ||
if (shapeIndex >= 0 && shapeIndex <= this.shapeHalfLength) { | ||
if (shapeIndex >= 0 && shapeIndex < this.shape.data.length) { | ||
this.data.y[index] += this.shape.data[shapeIndex] * intensity; | ||
@@ -179,3 +179,3 @@ } | ||
); | ||
if (shapeIndex >= 0 && shapeIndex <= this.shapeHalfLength) { | ||
if (shapeIndex >= 0 && shapeIndex <= this.shape.data.length) { | ||
this.data.y[index] += this.shape.data[shapeIndex] * intensity; | ||
@@ -182,0 +182,0 @@ } |
{ | ||
"name": "spectrum-generator", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "generate a spectrum from discrete peaks", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -16,3 +16,18 @@ /* eslint-disable jest/expect-expect */ | ||
expect(Math.min(...result.y)).toBeGreaterThan(99); | ||
expect(Math.max(...result.y)).toBeLessThanOrEqual(100); | ||
}); | ||
it('should be continuous 2', () => { | ||
const generator = new SpectrumGenerator({ | ||
from: 359.998, | ||
to: 360.001, | ||
nbPoints: 9, | ||
peakWidthFct: () => 0.013, | ||
}); | ||
generator.addPeak({ x: 359.99999514200909, y: 100 }); | ||
let result = generator.getSpectrum(); | ||
expect(Math.min(...result.y)).toBeGreaterThan(90); | ||
expect(Math.max(...result.y)).toBeLessThan(100); | ||
// expect(Math.min(...result.y)).toBeGreaterThan(99); | ||
}); | ||
}); |
@@ -112,3 +112,3 @@ import normed from 'ml-array-normed'; | ||
); | ||
if (shapeIndex >= 0 && shapeIndex <= this.shapeHalfLength) { | ||
if (shapeIndex >= 0 && shapeIndex < this.shape.data.length) { | ||
this.data.y[index] += this.shape.data[shapeIndex] * intensity; | ||
@@ -124,3 +124,3 @@ } | ||
); | ||
if (shapeIndex >= 0 && shapeIndex <= this.shapeHalfLength) { | ||
if (shapeIndex >= 0 && shapeIndex <= this.shape.data.length) { | ||
this.data.y[index] += this.shape.data[shapeIndex] * intensity; | ||
@@ -127,0 +127,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38716
1005