Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/lactame-head.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
- main

env:
NODE_VERSION: 20.x
NODE_VERSION: 24.x

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Get package name
run: echo "PACKAGE_NAME=$(jq .name package.json | tr -d '"')" >> $GITHUB_ENV
- uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lactame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
types: [published]

env:
NODE_VERSION: 20.x
NODE_VERSION: 24.x

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Get package name
run: echo "PACKAGE_NAME=$(jq .name package.json | tr -d '"')" >> $GITHUB_ENV
- uses: actions/setup-node@v4
Expand Down
33 changes: 8 additions & 25 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
name: Deploy TypeDoc on GitHub pages
name: TypeDoc

on:
workflow_dispatch:
release:
types: [published]

env:
NODE_VERSION: 20.x
ENTRY_FILE: 'src/index.ts'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm install
- name: Build documentation
uses: zakodium/typedoc-action@v2
with:
entry: ${{ env.ENTRY_FILE }}
- name: Deploy to GitHub pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
token: ${{ secrets.BOT_TOKEN }}
branch: gh-pages
folder: docs
clean: true
typedoc:
# Documentation: https://github.com/zakodium/workflows#typedoc
uses: zakodium/workflows/.github/workflows/typedoc.yml@typedoc-v1
with:
entry: 'src/index.ts'
secrets:
github-token: ${{ secrets.BOT_TOKEN }}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ jspm_packages
.node_repl_history

lib
lib-esm

dist

.DS_Store

docs
.eslintcache
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# ml-spectra-processing

[![NPM version][npm-image]][npm-url]
[![build status][ci-image]][ci-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[![NPM version](https://img.shields.io/npm/v/ml-spectra-processing.svg)](https://www.npmjs.com/package/ml-spectra-processing)
[![npm download](https://img.shields.io/npm/dm/ml-spectra-processing.svg)](https://www.npmjs.com/package/ml-spectra-processing)
[![test coverage](https://img.shields.io/codecov/c/github/mljs/spectra-processing.svg)](https://codecov.io/gh/mljs/spectra-processing)
[![license](https://img.shields.io/npm/l/ml-spectra-processing.svg)](https://github.com/mljs/spectra-processing/blob/main/LICENSE)
[![DOI](https://www.zenodo.org/badge/196417515.svg)](https://www.zenodo.org/badge/latestdoi/196417515)

Various functions to process spectra. Those are `pure` functions.

They are sorted in various categories:

- matrix: functions on ml-matrix instances (or array or array)
- matrix: functions on ml-matrix instances (or array of arrays)
- x: functions that apply on a 1D array
- xy: functions that apply on an object `{x: [], y:[]}`
- xy2: functions that apply on an array of array of 2 numbers `[[x,y], [x,y]]`
- xy2: functions that apply on an array of arrays of 2 numbers `[[x,y], [x,y]]`
- xyArray: functions that apply on an array of objects `{x: [], y:[]}`
- xyObject: functions that apply on an array of point `[{x,y}]`
- xreim: functions that apply on an object `{x: [], re:[], im:[]}`
Expand All @@ -25,7 +25,9 @@ The name of the functions start with the first argument on which they apply.

## Installation

`$ npm i ml-spectra-processing`
```console
npm install ml-spectra-processing
```

## Usage

Expand All @@ -42,12 +44,3 @@ console.log(result);
## License

[MIT](./LICENSE)

[npm-image]: https://img.shields.io/npm/v/ml-spectra-processing.svg
[npm-url]: https://www.npmjs.com/package/ml-spectra-processing
[ci-image]: https://github.com/mljs/spectra-processing/actions/workflows/nodejs.yml/badge.svg
[ci-url]: https://github.com/mljs/spectra-processing/actions/workflows/nodejs.yml
[codecov-image]: https://img.shields.io/codecov/c/github/mljs/spectra-processing.svg
[codecov-url]: https://codecov.io/gh/mljs/spectra-processing
[download-image]: https://img.shields.io/npm/dm/ml-spectra-processing.svg
[download-url]: https://www.npmjs.com/package/ml-spectra-processing
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { defineConfig, globalIgnores } from 'eslint/config';
import cheminfo from 'eslint-config-cheminfo-typescript';

export default defineConfig(globalIgnores(['coverage', 'lib']), cheminfo);
23 changes: 0 additions & 23 deletions eslint.config.mjs

This file was deleted.

126 changes: 44 additions & 82 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,109 +1,71 @@
{
"name": "ml-spectra-processing",
"version": "14.16.1",
"license": "MIT",
"description": "Various method to process spectra",
"main": "./lib/index.js",
"module": "./lib-esm/index.js",
"types": "./lib/index.d.ts",
"keywords": [],
"author": "Luc Patiny",
"type": "module",
"exports": {
".": {
"node": "./lib/index.js",
"default": "./lib-esm/index.js"
},
"./matrix": {
"node": "./lib/matrix/index.js",
"default": "./lib-esm/matrix/index.js"
},
"./reim": {
"node": "./lib/reim/index.js",
"default": "./lib-esm/reim/index.js"
},
"./utils": {
"node": "./lib/utils/index.js",
"default": "./lib-esm/utils/index.js"
},
"./x": {
"node": "./lib/x/index.js",
"default": "./lib-esm/x/index.js"
},
"./xreim": {
"node": "./lib/xreim/index.js",
"default": "./lib-esm/xreim/index.js"
},
"./xy": {
"node": "./lib/xy/index.js",
"default": "./lib-esm/xy/index.js"
},
"./xy2": {
"node": "./lib/xy2/index.js",
"default": "./lib-esm/xy2/index.js"
},
"./xyArray": {
"node": "./lib/xyArray/index.js",
"default": "./lib-esm/xyArray/index.js"
},
"./xyObject": {
"node": "./lib/xyObject/index.js",
"default": "./lib-esm/xyObject/index.js"
},
"./zones": {
"node": "./lib/zones/index.js",
"default": "./lib-esm/zones/index.js"
}
".": "./lib/index.js",
"./matrix": "./lib/matrix/index.js",
"./reim": "./lib/reim/index.js",
"./utils": "./lib/utils/index.js",
"./x": "./lib/x/index.js",
"./xreim": "./lib/xreim/index.js",
"./xy": "./lib/xy/index.js",
"./xy2": "./lib/xy2/index.js",
"./xyArray": "./lib/xyArray/index.js",
"./xyObject": "./lib/xyObject/index.js",
"./zones": "./lib/zones/index.js"
},
"files": [
"src",
"lib",
"lib-esm"
"src"
],
"scripts": {
"build": "npm run tsc-esm && cheminfo-build --entry lib-esm/index.js --root SpectraProcessing",
"build": "npm run tsc && cheminfo-build --entry lib/index.js --root SpectraProcessing",
"check-types": "tsc --noEmit",
"clean": "rimraf lib lib-esm",
"eslint": "eslint src",
"eslint-fix": "npm run eslint -- --fix",
"jscpd": "jscpd -l 10 -i \"**/__tests__/**\" -t 1 src",
"clean": "rimraf coverage dist lib",
"eslint": "eslint . --cache",
"eslint-fix": "eslint . --cache --fix",
"prepack": "npm run tsc",
"prettier": "prettier --check src",
"prettier-write": "prettier --write src",
"test": "npm run test-only && npm run eslint && npm run prettier && npm run check-types",
"prettier": "prettier --check .",
"prettier-write": "prettier --write .",
"test": "npm run test-only && npm run check-types && npm run eslint && npm run prettier",
"test-only": "vitest run --coverage",
"tsc": "npm run clean && npm run tsc-cjs && npm run tsc-esm",
"tsc-cjs": "tsc --project tsconfig.cjs.json",
"tsc-esm": "tsc --project tsconfig.esm.json"
"tsc": "npm run clean && npm run tsc-build",
"tsc-build": "tsc --project tsconfig.build.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mljs/spectra-processing.git"
},
"keywords": [],
"author": "Luc Patiny",
"license": "MIT",
"bugs": {
"url": "https://github.com/mljs/spectra-processing/issues"
"dependencies": {
"binary-search": "^1.3.6",
"cheminfo-types": "^1.8.1",
"fft.js": "^4.0.4",
"is-any-array": "^2.0.1",
"ml-matrix": "^6.12.1",
"ml-xsadd": "^3.0.1"
},
"homepage": "https://github.com/mljs/spectra-processing#readme",
"devDependencies": {
"@types/node": "^24.2.0",
"@types/node": "^24.3.0",
"@vitest/coverage-v8": "^3.2.4",
"@zakodium/tsconfig": "^1.0.2",
"cheminfo-build": "^1.2.1",
"eslint": "^9.32.0",
"eslint": "^9.33.0",
"eslint-config-cheminfo-typescript": "^19.0.0",
"jest-matcher-deep-close-to": "^3.0.2",
"jscpd": "^4.0.5",
"ml-spectra-fitting": "^4.2.4",
"ml-spectra-fitting": "^5.0.1",
"prettier": "^3.6.2",
"rimraf": "^6.0.1",
"spectrum-generator": "^8.1.0",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
},
"dependencies": {
"binary-search": "^1.3.6",
"cheminfo-types": "^1.8.1",
"fft.js": "^4.0.4",
"is-any-array": "^2.0.1",
"ml-matrix": "^6.12.1",
"ml-xsadd": "^3.0.1"
}
"repository": {
"type": "git",
"url": "git+https://github.com/mljs/spectra-processing.git"
},
"bugs": {
"url": "https://github.com/mljs/spectra-processing/issues"
},
"homepage": "https://github.com/mljs/spectra-processing#readme"
}
1 change: 1 addition & 0 deletions src/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__tests__
*.test.*
.npmignore
2 changes: 1 addition & 1 deletion src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest';

import * as SpectraProcessing from '../index';
import * as SpectraProcessing from '../index.ts';

test('test existence of exported functions', () => {
const exports = Object.keys(SpectraProcessing);
Expand Down
22 changes: 11 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export * from './reim/index';
export * from './reim/index.ts';

export * from './x/index';
export * from './x/index.ts';

export * from './xy/index';
export * from './xy/index.ts';

export * from './xy2/index';
export * from './xy2/index.ts';

export * from './xreim/index';
export * from './xreim/index.ts';

export * from './xyArray/index';
export * from './xyObject/index';
export * from './xyArray/index.ts';
export * from './xyObject/index.ts';

export * from './zones/index';
export * from './zones/index.ts';

export * from './matrix/index';
export * from './utils/index';
export * from './matrix/index.ts';
export * from './utils/index.ts';

export * from './types/index';
export * from './types/index.ts';
2 changes: 1 addition & 1 deletion src/matrix/__tests__/matrixAbsoluteMedian.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest';

import { matrixAbsoluteMedian } from '../matrixAbsoluteMedian';
import { matrixAbsoluteMedian } from '../matrixAbsoluteMedian.ts';

test('matrixAbsoluteMedian', () => {
const matrix = [
Expand Down
6 changes: 3 additions & 3 deletions src/matrix/__tests__/matrixApplyNumericalDecoding.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { expect, test } from 'vitest';

import { matrixApplyNumericalEncoding } from '../matrixApplyNumericalEncoding';
import { matrixNumericalEncoding } from '../matrixNumericalEncoding';
import { matrixApplyNumericalEncoding } from '../matrixApplyNumericalEncoding.ts';
import { matrixNumericalEncoding } from '../matrixNumericalEncoding.ts';

import { datasetForEncoding } from './fixtures/encoding';
import { datasetForEncoding } from './fixtures/encoding.ts';

const datasetToEncode = [
[78, 'o', 'ab', 147],
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/__tests__/matrixAutoCorrelation.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest';

import { matrixAutoCorrelation } from '../matrixAutoCorrelation';
import { matrixAutoCorrelation } from '../matrixAutoCorrelation.ts';

test('simple', () => {
const matrix = [
Expand Down
Loading
Loading