Comparing version 5.0.2 to 5.0.3
import { ensureString } from 'ensure-string'; | ||
import mlArrayMax from 'ml-array-max'; | ||
import uniqueXFunction from 'ml-arrayxy-uniquex'; | ||
import { xIsMonotone } from 'ml-spectra-processing'; | ||
import { xyUniqueX, xMaxValue, xIsMonotone } from 'ml-spectra-processing'; | ||
/** | ||
@@ -83,3 +81,3 @@ * General internal parsing function | ||
} | ||
const result = { | ||
let result = { | ||
x: matrix.map((row) => row[xColumn]), | ||
@@ -89,6 +87,6 @@ y: matrix.map((row) => row[yColumn]), | ||
if (uniqueX) { | ||
uniqueXFunction(result); | ||
result = xyUniqueX(result, { algorithm: 'sum' }); | ||
} | ||
if (rescale) { | ||
let maxY = mlArrayMax(result.y); | ||
let maxY = xMaxValue(result.y); | ||
for (let i = 0; i < result.y.length; i++) { | ||
@@ -95,0 +93,0 @@ result.y[i] /= maxY; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parse = void 0; | ||
const ensure_string_1 = require("ensure-string"); | ||
const ml_array_max_1 = __importDefault(require("ml-array-max")); | ||
const ml_arrayxy_uniquex_1 = __importDefault(require("ml-arrayxy-uniquex")); | ||
const ml_spectra_processing_1 = require("ml-spectra-processing"); | ||
@@ -89,3 +84,3 @@ /** | ||
} | ||
const result = { | ||
let result = { | ||
x: matrix.map((row) => row[xColumn]), | ||
@@ -95,6 +90,6 @@ y: matrix.map((row) => row[yColumn]), | ||
if (uniqueX) { | ||
(0, ml_arrayxy_uniquex_1.default)(result); | ||
result = (0, ml_spectra_processing_1.xyUniqueX)(result, { algorithm: 'sum' }); | ||
} | ||
if (rescale) { | ||
let maxY = (0, ml_array_max_1.default)(result.y); | ||
let maxY = (0, ml_spectra_processing_1.xMaxValue)(result.y); | ||
for (let i = 0; i < result.y.length; i++) { | ||
@@ -101,0 +96,0 @@ result.y[i] /= maxY; |
{ | ||
"name": "xy-parser", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Parse a text-file and convert it to an array of XY points", | ||
@@ -44,21 +44,19 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@types/jest": "^27.4.1", | ||
"@types/jest": "^29.2.3", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", | ||
"cheminfo-tools": "^1.23.3", | ||
"codecov": "^3.8.3", | ||
"eslint": "^8.11.0", | ||
"eslint-config-cheminfo-typescript": "^10.4.0", | ||
"jest": "^27.5.1", | ||
"prettier": "^2.5.1", | ||
"eslint": "^8.28.0", | ||
"eslint-config-cheminfo-typescript": "^11.2.2", | ||
"jest": "^29.3.1", | ||
"prettier": "^2.8.0", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^27.1.3", | ||
"typescript": "^4.6.2" | ||
"ts-jest": "^29.0.3", | ||
"typescript": "^4.9.3" | ||
}, | ||
"dependencies": { | ||
"cheminfo-types": "^1.1.0", | ||
"ensure-string": "^1.1.0", | ||
"ml-array-max": "^1.2.4", | ||
"ml-arrayxy-uniquex": "1.0.2", | ||
"ml-spectra-processing": "^11.0.0" | ||
"cheminfo-types": "^1.4.0", | ||
"ensure-string": "^1.2.0", | ||
"ml-spectra-processing": "^11.14.0" | ||
} | ||
} |
import { DataXY, TextData } from 'cheminfo-types'; | ||
import { ensureString } from 'ensure-string'; | ||
import mlArrayMax from 'ml-array-max'; | ||
import uniqueXFunction from 'ml-arrayxy-uniquex'; | ||
import { xIsMonotone } from 'ml-spectra-processing'; | ||
import { xyUniqueX, xMaxValue, xIsMonotone } from 'ml-spectra-processing'; | ||
@@ -114,3 +112,3 @@ import { ParseXYOptions } from './ParseXYOptions'; | ||
} | ||
const result = { | ||
let result: DataXY = { | ||
x: matrix.map((row) => row[xColumn]), | ||
@@ -121,7 +119,7 @@ y: matrix.map((row) => row[yColumn]), | ||
if (uniqueX) { | ||
uniqueXFunction(result); | ||
result = xyUniqueX(result, { algorithm: 'sum' }); | ||
} | ||
if (rescale) { | ||
let maxY = mlArrayMax(result.y); | ||
let maxY = xMaxValue(result.y); | ||
for (let i = 0; i < result.y.length; i++) { | ||
@@ -128,0 +126,0 @@ result.y[i] /= maxY; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
3
43709
864
- Removedml-array-max@^1.2.4
- Removedml-arrayxy-uniquex@1.0.2
- Removedml-arrayxy-uniquex@1.0.2(transitive)
Updatedcheminfo-types@^1.4.0
Updatedensure-string@^1.2.0