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

ml-spectra-processing

Package Overview
Dependencies
Maintainers
6
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-spectra-processing - npm Package Compare versions

Comparing version 6.4.0 to 6.5.0

12

CHANGELOG.md
# Changelog
## [6.5.0](https://www.github.com/mljs/spectra-processing/compare/v6.4.0...v6.5.0) (2021-05-04)
### Features
* optimize xySortX if already sorted ([e6dac65](https://www.github.com/mljs/spectra-processing/commit/e6dac65c584b9dcc64a5add1e9819051cf476db4))
### Bug Fixes
* script to deploy documentation ([2c2cbee](https://www.github.com/mljs/spectra-processing/commit/2c2cbee01967156ab1a2578ae0f8c6fbe8a3fd02))
## [6.4.0](https://www.github.com/mljs/spectra-processing/compare/v6.3.0...v6.4.0) (2021-05-04)

@@ -4,0 +16,0 @@

2

package.json
{
"name": "ml-spectra-processing",
"version": "6.4.0",
"version": "6.5.0",
"description": "Various method to process spectra",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -0,3 +1,5 @@

import { xIsMonotone } from '../x/xIsMonotone';
/**
*This function performs a quick sort of the x array while transforming the y array to preserve the coordinates.
import { xIsMonotone } from '../x/xIsMonotone';
* This function performs a quick sort of the x array while transforming the y array to preserve the coordinates.
* @param {DataXY} [data] Object that contains property x (Array) and y (Array)

@@ -8,2 +10,17 @@ */

// no need to sort if it is already sorted
if (xIsMonotone(x) && x.length > 1) {
if (x[0] < x[1]) {
return {
x: Float64Array.from(x),
y: Float64Array.from(y),
};
} else {
return {
x: Float64Array.from(x).reverse(),
y: Float64Array.from(y).reverse(),
};
}
}
let xyObject = x

@@ -16,6 +33,9 @@ .map((val, index) => ({

let response = { x: [], y: [] };
let response = {
x: new Float64Array(x.length),
y: new Float64Array(y.length),
};
for (let i = 0; i < x.length; i++) {
response.x.push(xyObject[i].x);
response.y.push(xyObject[i].y);
response.x[i] = xyObject[i].x;
response.y[i] = xyObject[i].y;
}

@@ -22,0 +42,0 @@

Sorry, the diff of this file is too big to display

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