Skip to content

Commit 18ac5a6

Browse files
jobo322targos
andauthored
fix(xWhittakerSmoother): use correct name to whittaker smoother (#311)
fix(xWhittakerSmoother): ensure baseline is initialized as Float64Array fix: support TypeScript 5.9 TypedArray changes Refs: https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/#lib.d.ts-changes Co-authored-by: Michaël Zasso <targos@protonmail.com>
1 parent 8214453 commit 18ac5a6

40 files changed

+90
-59
lines changed

src/__tests__/__snapshots__/index.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ exports[`test existence of exported functions 1`] = `
7474
"xSum",
7575
"xUniqueSorted",
7676
"xVariance",
77+
"xWhittakerSmoother",
7778
"xWhitakerSmoother",
7879
"xyReduce",
7980
"xyAlign",

src/matrix/matrixAutoCorrelation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { xCorrelation } from '../x';
44
export function matrixAutoCorrelation(
55
matrix: DoubleMatrix,
66
index = 0,
7-
): Float64Array {
7+
): Float64Array<ArrayBuffer> {
88
const nbRows = matrix.length;
99
const nbColumns = matrix[0].length;
1010

src/matrix/matrixCenterZMean.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import { matrixCreateEmpty } from './matrixCreateEmpty';
66
* Center mean of matrix columns.
77
* @param matrix - matrix [rows][cols]
88
*/
9-
export function matrixCenterZMean(matrix: DoubleMatrix): Float64Array[] {
9+
export function matrixCenterZMean(
10+
matrix: DoubleMatrix,
11+
): Array<Float64Array<ArrayBuffer>> {
1012
const nbColumns = matrix[0].length;
1113
const nbRows = matrix.length;
1214
const newMatrix = matrixCreateEmpty({ nbColumns, nbRows });

src/matrix/matrixColumnsCorrelation.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import { xCorrelation } from '../x';
77
* Calculates a correlation matrix based on the columns of the initial matrix.
88
* @param A - matrix [rows][cols]
99
*/
10-
export function matrixColumnsCorrelation(A: DoubleMatrix): Float64Array[] {
10+
export function matrixColumnsCorrelation(
11+
A: DoubleMatrix,
12+
): Array<Float64Array<ArrayBuffer>> {
1113
const B = new Matrix(A).transpose();
12-
const result: Float64Array[] = [];
14+
const result: Array<Float64Array<ArrayBuffer>> = [];
1315
for (let i = 0; i < B.rows; i++) {
1416
result.push(new Float64Array(B.rows));
1517
}

src/matrix/matrixCuthillMckee.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
export function matrixCuthillMckee(
3535
list: number[][],
3636
dimension: number,
37-
): Float64Array {
37+
): Float64Array<ArrayBuffer> {
3838
const adj: number[][] = new Array(dimension);
3939
const visited: boolean[] = new Array(dimension).fill(false);
4040
for (let i = 0; i < dimension; ++i) {

src/matrix/matrixToArray.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { matrixCheck } from './matrixCheck';
66
* Convert a matrix to a flat Float64Array.
77
* @param matrix
88
*/
9-
export function matrixToArray(matrix: DoubleMatrix): Float64Array {
9+
export function matrixToArray(matrix: DoubleMatrix): Float64Array<ArrayBuffer> {
1010
matrixCheck(matrix);
1111

1212
const nbColumns = matrix[0].length;

src/matrix/matrixTranspose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { NumberArrayConstructor } from '../utils';
2-
import { matrixCheck } from './matrixCheck';
32

3+
import { matrixCheck } from './matrixCheck';
44
import { matrixCreateEmpty } from './matrixCreateEmpty';
55

66
export interface MatrixTransposeOptions<

src/matrix/matrixZRescalePerColumn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface MatrixZRescalePerColumnOptions {
2424
export function matrixZRescalePerColumn(
2525
matrix: DoubleMatrix,
2626
options: MatrixZRescalePerColumnOptions = {},
27-
): Float64Array[] {
27+
): Array<Float64Array<ArrayBuffer>> {
2828
const { min = 0, max = 1 } = options;
2929
const nbColumns = matrix[0].length;
3030
const nbRows = matrix.length;

src/reim/reimAbsolute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { DataReIm } from '../types';
55
* @param data - complex spectrum
66
* @returns - reimAbsolute value
77
*/
8-
export function reimAbsolute(data: DataReIm): Float64Array {
8+
export function reimAbsolute(data: DataReIm): Float64Array<ArrayBuffer> {
99
const length = data.re.length;
1010
const re = data.re;
1111
const im = data.im;

src/reim/reimAutoPhaseCorrection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function autoPhaseRegion(
207207
* @param s - Array of float.
208208
* @returns Array of float.
209209
*/
210-
function holoborodko(s: DoubleArray): Float64Array {
210+
function holoborodko(s: DoubleArray): Float64Array<ArrayBuffer> {
211211
const dk = new Float64Array(s.length);
212212
for (let i = 5; i < s.length - 5; i++) {
213213
dk[i] =

0 commit comments

Comments
 (0)