Skip to content

Commit

Permalink
feat!: Improve fromXML performances that requires async function
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Dec 19, 2024
1 parent acde453 commit 494e4a6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion chromatography.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,4 +899,4 @@ export function fromNetCDF(netcdf: any): Chromatogram;
* Creates a new Chromatogram from supported XML formats.
* @param xml - String containing the XML chromatogram.
*/
export function fromXML(xml: string): Chromatogram;
export async function fromXML(xml: string): Chromatogram;
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,39 @@
},
"homepage": "https://github.com/cheminfo/chromatography#readme",
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
"@types/jest": "^29.5.12",
"@vitest/coverage-v8": "^2.0.5",
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
"@vitest/coverage-v8": "^2.1.8",
"cheminfo-build": "^1.2.0",
"convert-to-jcamp": "^5.4.11",
"eslint": "^8.57.0",
"eslint-config-cheminfo": "^11.1.1",
"eslint": "^9.17.0",
"eslint-config-cheminfo": "^13.0.0",
"esm": "^3.2.25",
"jest-matcher-deep-close-to": "^3.0.2",
"prettier": "^3.3.3",
"rollup": "^4.21.1",
"spectrum-generator": "^8.0.11",
"typescript": "^5.5.4"
"prettier": "^3.4.2",
"rollup": "^4.28.1",
"spectrum-generator": "^8.0.12",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
},
"dependencies": {
"binary-search": "^1.3.6",
"is-any-array": "^2.0.1",
"isotopic-distribution": "^3.3.1",
"jcampconverter": "^9.6.4",
"mf-generator": "^3.3.3",
"mf-parser": "^3.2.3",
"isotopic-distribution": "^3.4.8",
"jcampconverter": "^10.0.1",
"mf-generator": "^3.3.11",
"mf-parser": "^3.3.0",
"ml-airpls": "^2.0.0",
"ml-array-max": "^1.2.4",
"ml-array-mean": "^1.1.6",
"ml-array-median": "^1.1.6",
"ml-array-sum": "^1.1.6",
"ml-gsd": "^12.1.6",
"ml-matrix": "^6.11.1",
"ml-gsd": "^12.1.8",
"ml-matrix": "^6.12.0",
"ml-ngmca": "^1.0.0",
"ml-pca": "^4.1.1",
"ml-regression-polynomial": "^3.0.1",
"ml-spectra-processing": "^14.5.3",
"mzdata": "^2.3.1",
"ml-spectra-processing": "^14.9.0",
"mzdata": "^3.0.0",
"netcdf-gcms": "^3.0.0",
"xy-parser": "^5.0.5"
}
Expand Down
4 changes: 2 additions & 2 deletions src/from/__tests__/xml.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { describe, it, expect } from 'vitest';
import { fromXML } from '../..';

describe('mzML data files', () => {
it('mzData', () => {
it('mzData', async () => {
const path = join(__dirname, '../../../testFiles/mzML/test.mzdata.xml');
const mzData = readFileSync(path);
const chromatogram = fromXML(mzData);
const chromatogram = await fromXML(mzData);
expect(chromatogram).toHaveLength(3029);
});
});
4 changes: 2 additions & 2 deletions src/from/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { parseMZ } from 'mzdata';

import { fromJSON } from '../Chromatogram';

export function fromXML(xml) {
return fromJSON(parseMZ(xml));
export async function fromXML(xml) {

Check warning on line 5 in src/from/xml.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc comment
return fromJSON(await parseMZ(xml));
}

0 comments on commit 494e4a6

Please sign in to comment.