Skip to content

Commit

Permalink
feat: update dependencies
Browse files Browse the repository at this point in the history
lpatiny committed Oct 9, 2024
1 parent 1b4276c commit 7325a44
Showing 4 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -36,17 +36,17 @@
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
"@types/node": "^22.7.4",
"@types/node": "^22.7.5",
"@vitest/coverage-v8": "^2.1.2",
"cheminfo-build": "^1.2.0",
"eslint": "^8.57.0",
"eslint-config-cheminfo": "^11.1.2",
"eslint": "^9.12.0",
"eslint-config-cheminfo": "^12.0.1",
"jest-matcher-deep-close-to": "^3.0.2",
"prettier": "^3.3.3",
"rollup": "^4.24.0"
},
"dependencies": {
"common-spectrum": "2.10.1",
"common-spectrum": "2.12.0",
"ml-gsd": "^12.1.8",
"vitest": "^2.1.2"
},
12 changes: 6 additions & 6 deletions src/from/__tests__/fromJcamp.test.js
Original file line number Diff line number Diff line change
@@ -2,12 +2,11 @@ import { readFileSync } from 'node:fs';
import { join } from 'node:path';

import { getNormalizedSpectrum } from 'common-spectrum';
import { test, expect } from 'vitest'
import { test, expect } from 'vitest';

import { fromJcamp } from '../..';

test('fromJcamp', () => {

const arrayBuffer = readFileSync(join(__dirname, 'data/uv.jdx'));
const analysis = fromJcamp(arrayBuffer, {
info: {
@@ -19,7 +18,6 @@ test('fromJcamp', () => {
},
});


expect(analysis.spectra).toHaveLength(1);

let first = analysis.spectra[0];
@@ -32,9 +30,11 @@ test('fromJcamp', () => {
expect(first.variables.y.label).toBe('Reflectance');
expect(first.variables.y.units).toBe(undefined);

const spectrumTauc = analysis.getXYSpectrum({ variables: 'c vs e' })
const normalizedTauc = getNormalizedSpectrum(spectrumTauc, { from: 2.5, to: 3.5 }).variables;
const spectrumTauc = analysis.getXYSpectrum({ variables: 'c vs e' });
const normalizedTauc = getNormalizedSpectrum(spectrumTauc, {
from: 2.5,
to: 3.5,
}).variables;
expect(normalizedTauc.x.data).toHaveLength(141);
expect(normalizedTauc.y.data).toHaveLength(141);

});
3 changes: 1 addition & 2 deletions src/from/__tests__/fromText.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';

import { test, expect } from 'vitest'
import { test, expect } from 'vitest';

import { fromText } from '../..';

@@ -19,7 +19,6 @@ test('fromText', () => {

expect(analysis.spectra).toHaveLength(1);


let first = analysis.spectra[0];

expect(first.variables.x.data).toHaveLength(551);
2 changes: 1 addition & 1 deletion src/from/utils/spectrumCallback.js
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ function parseAbsorbance(variables) {
} else {
const factor =
yVariable.label.includes('%') ||
yVariable.label.toLowerCase().includes('percent')
yVariable.label.toLowerCase().includes('percent')
? 100
: 1;

0 comments on commit 7325a44

Please sign in to comment.