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

spectrum-generator

Package Overview
Dependencies
Maintainers
7
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spectrum-generator - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

9

History.md

@@ -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 @@

4

lib/index.js

@@ -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 @@ }

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