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

nmr-simulation

Package Overview
Dependencies
Maintainers
8
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nmr-simulation - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

4

lib/simulate1D.js

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

var i, j;
const {
var {
lineWidth = 1,

@@ -42,2 +42,4 @@ nbPoints = 1024,

nbPoints = Number(nbPoints);
const from = options.from * frequencyMHz || 0;

@@ -44,0 +46,0 @@ const to = (options.to || 10) * frequencyMHz;

@@ -95,18 +95,24 @@ 'use strict';

let atomIDs = pred.atomIDs;
for (let i = 0; i < atomIDs.length; i++) {
let tempPred = JSON.parse(JSON.stringify(pred));
let nmrJ = [];
tempPred.atomIDs = [atomIDs[i]];
tempPred.integral = 1;
for (let j = 0; j < tempPred.j.length; j++) {
let assignment = tempPred.j[j].assignment;
for (let k = 0; k < assignment.length; k++) {
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j]));
tempJ.assignment = assignment[k];
nmrJ.push(tempJ);
if (atomIDs instanceof Array) {
for (let i = 0; i < atomIDs.length; i++) {
let tempPred = JSON.parse(JSON.stringify(pred));
let nmrJ = [];
tempPred.atomIDs = [atomIDs[i]];
tempPred.integral = 1;
if (tempPred.j instanceof Array) {
for (let j = 0; j < tempPred.j.length; j++) {
let assignment = tempPred.j[j].assignment;
if (assignment instanceof Array) {
for (let k = 0; k < assignment.length; k++) {
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j]));
tempJ.assignment = assignment[k];
nmrJ.push(tempJ);
}
}
}
}
tempPred.j = nmrJ;
delete tempPred.nbAtoms;
result.push(tempPred);
}
tempPred.j = nmrJ;
delete tempPred.nbAtoms;
result.push(tempPred);
}

@@ -113,0 +119,0 @@ });

{
"name": "nmr-simulation",
"version": "1.0.12",
"version": "1.0.13",
"description": "Simulate NMR spectra from spin systems",

@@ -38,4 +38,4 @@ "main": "lib/index.js",

"devDependencies": {
"nmr-predictor": "^1.1.5"
"nmr-predictor": "^1.1.6"
}
}

@@ -12,3 +12,3 @@ import Matrix from 'ml-matrix';

var i, j;
const {
var {
lineWidth = 1,

@@ -22,2 +22,4 @@ nbPoints = 1024,

nbPoints = Number(nbPoints);
const from = options.from * frequencyMHz || 0;

@@ -24,0 +26,0 @@ const to = (options.to || 10) * frequencyMHz;

@@ -77,18 +77,24 @@ import Matrix from 'ml-matrix';

let atomIDs = pred.atomIDs;
for (let i = 0; i < atomIDs.length; i++) {
let tempPred = JSON.parse(JSON.stringify(pred));
let nmrJ = [];
tempPred.atomIDs = [atomIDs[i]];
tempPred.integral = 1;
for (let j = 0; j < tempPred.j.length; j++) {
let assignment = tempPred.j[j].assignment;
for (let k = 0; k < assignment.length; k++) {
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j]));
tempJ.assignment = assignment[k];
nmrJ.push(tempJ);
if (atomIDs instanceof Array) {
for (let i = 0; i < atomIDs.length; i++) {
let tempPred = JSON.parse(JSON.stringify(pred));
let nmrJ = [];
tempPred.atomIDs = [atomIDs[i]];
tempPred.integral = 1;
if (tempPred.j instanceof Array) {
for (let j = 0; j < tempPred.j.length; j++) {
let assignment = tempPred.j[j].assignment;
if (assignment instanceof Array) {
for (let k = 0; k < assignment.length; k++) {
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j]));
tempJ.assignment = assignment[k];
nmrJ.push(tempJ);
}
}
}
}
tempPred.j = nmrJ;
delete tempPred.nbAtoms;
result.push(tempPred);
}
tempPred.j = nmrJ;
delete tempPred.nbAtoms;
result.push(tempPred);
}

@@ -95,0 +101,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