Skip to content

Commit d8bd3e7

Browse files
targoslpatiny
andauthored
chore: update dependencies (#96)
BREAKING CHANGE: Move property fwhm to be into 'shape'. This ensure compability with our other packages. Co-authored-by: Luc Patiny <[email protected]>
1 parent b883b1d commit d8bd3e7

File tree

12 files changed

+40
-51
lines changed

12 files changed

+40
-51
lines changed

.github/workflows/lactame.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on:
55
types: [published]
66

77
env:
8-
NODE_VERSION: 14.x
8+
NODE_VERSION: 16.x
99

1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
- name: Get package name
1616
run: echo "PACKAGE_NAME=$(jq .name package.json | tr -d '"')" >> $GITHUB_ENV
1717
- uses: actions/setup-node@v2

.github/workflows/nodejs-ts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
# Documentation: https://github.com/zakodium/workflows#nodejs-ci
1212
uses: zakodium/workflows/.github/workflows/nodejs.yml@nodejs-v1
1313
with:
14-
node-version-matrix: '[14, 16]'
15-
lint-check-types: true
14+
node-version-matrix: '[14, 16, 18]'
15+
lint-check-types: true

.github/workflows/typedoc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
deploy:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-node@v2
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
1818
with:
1919
node-version: ${{ env.NODE_VERSION }}
2020
- name: Install dependencies
@@ -29,4 +29,4 @@ jobs:
2929
token: ${{ secrets.BOT_TOKEN }}
3030
branch: gh-pages
3131
folder: docs
32-
clean: true
32+
clean: true

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
presets: ['@babel/preset-typescript'],
3+
plugins: ['@babel/plugin-transform-modules-commonjs'],
4+
};

jest.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,31 @@
5858
"trailingComma": "all"
5959
},
6060
"devDependencies": {
61+
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
62+
"@babel/preset-typescript": "^7.16.7",
6163
"@types/jest": "^27.4.1",
6264
"chemcalc": "^3.4.1",
6365
"cheminfo-build": "^1.1.11",
64-
"eslint": "^8.10.0",
66+
"eslint": "^8.14.0",
6567
"eslint-config-cheminfo-typescript": "^10.4.0",
66-
"eslint-plugin-jest": "^26.1.1",
68+
"eslint-plugin-jest": "^26.1.5",
6769
"esm": "^3.2.25",
68-
"jest": "^27.5.1",
70+
"jest": "^28.0.3",
6971
"jest-matcher-deep-close-to": "^3.0.2",
70-
"mf-global": "^1.4.23",
72+
"mf-global": "^1.4.24",
7173
"ml-stat": "^1.3.3",
72-
"nodemon": "^2.0.15",
73-
"prettier": "^2.5.1",
74+
"nodemon": "^2.0.16",
75+
"prettier": "^2.6.2",
7476
"rimraf": "^3.0.2",
75-
"spectrum-generator": "^8.0.0",
76-
"ts-jest": "^27.1.3",
77-
"typescript": "^4.6.2",
78-
"xy-parser": "^5.0.1"
77+
"spectrum-generator": "^8.0.1",
78+
"typescript": "^4.6.4",
79+
"xy-parser": "^5.0.2"
7980
},
8081
"dependencies": {
8182
"cheminfo-types": "^1.1.0",
8283
"ml-peak-shape-generator": "^4.1.1",
8384
"ml-savitzky-golay-generalized": "4.0.1",
84-
"ml-spectra-fitting": "3.0.4",
85-
"ml-spectra-processing": "^11.0.0"
85+
"ml-spectra-fitting": "4.0.1",
86+
"ml-spectra-processing": "^11.5.0"
8687
}
8788
}

src/GSDPeakOptimized.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ export interface GSDPeakOptimized {
44
x: number;
55
y: number;
66
width: number;
7-
fwhm: number;
87
shape: Shape1D;
98
}

src/__tests__/gaussian-overlapping.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ describe('gaussian overlapping', () => {
4949
x: -0.1,
5050
y: 1,
5151
width: 0.1,
52-
fwhm: 0.11774128880591818,
53-
shape: { kind: 'gaussian' },
52+
shape: { kind: 'gaussian', fwhm: 0.11774128880591818 },
5453
},
5554
{
5655
x: 0.1,
5756
y: 1,
5857
width: 0.1,
59-
fwhm: 0.11774128880591818,
60-
shape: { kind: 'gaussian' },
58+
shape: { kind: 'gaussian', fwhm: 0.11774128880591818 },
6159
},
6260
]);
6361
});

src/post/__tests__/optimizePeaks.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ describe('optimizePeaks', () => {
3131
{
3232
x: 0,
3333
y: 1,
34-
fwhm: 0.14128970668640126,
3534
width: 0.12,
3635
shape: {
3736
kind: 'gaussian',
37+
fwhm: 0.14128970668640126,
3838
},
3939
},
4040
]);
4141

4242
const options = {
4343
optimization: {
44-
kind: 'lm',
44+
kind: 'lm' as const,
4545
options: {
4646
timeout: 0,
4747
},

src/post/optimizePeaks.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { DataXY } from 'cheminfo-types';
2-
import { PeakXYWidth } from 'cheminfo-types';
1+
import type { DataXY, PeakXYWidth } from 'cheminfo-types';
32
import { getShape1D, Shape1D } from 'ml-peak-shape-generator';
43
import { optimize } from 'ml-spectra-fitting';
54
import type { OptimizationOptions } from 'ml-spectra-fitting';
@@ -90,11 +89,10 @@ export function optimizePeaks(
9089
});
9190
for (let i = 0; i < peaks.length; i++) {
9291
results.push({
93-
x: optimizedPeaks[i].x,
94-
y: optimizedPeaks[i].y,
95-
shape: peaks[i].shape,
96-
fwhm: optimizedPeaks[i].fwhm || 0, // todo remove || 0 it should never happen after update spectra-fitting
97-
width: getShape1D(peaks[i].shape).fwhmToWidth(optimizedPeaks[i].fwhm),
92+
...optimizedPeaks[i],
93+
width: getShape1D(peaks[i].shape).fwhmToWidth(
94+
optimizedPeaks[i].shape.fwhm,
95+
),
9896
});
9997
}
10098
} else {

0 commit comments

Comments
 (0)