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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
npm: true
secrets:
github-token: ${{ secrets.BOT_TOKEN }}
npm-token: ${{ secrets.NPM_BOT_TOKEN }}
npm-token: ${{ secrets.NPM_BOT_TOKEN }}
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 }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "always",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
78 changes: 33 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
{
"name": "linear-sum-assignment",
"version": "1.0.8",
"license": "MIT",
"description": "it performs a linear sum assignment even if the cost matrix is rectangular.",
"main": "./lib/index.js",
"module": "./lib-esm/index.js",
"types": "./lib/index.d.ts",
"keywords": [],
"author": "J Alejandro Bolanos A <jobo322>",
"license": "MIT",
"type": "module",
"exports": {
".": "./lib/index.js"
},
"files": [
"src",
"lib",
"lib-esm"
"src"
],
"scripts": {
"clean": "rimraf lib lib-esm",
"check-types": "tsc --noEmit",
"eslint": "eslint src --ext ts --cache",
"eslint-fix": "npm run eslint -- --fix",
"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-coverage && npm run eslint",
"test-coverage": "npm run test-only -- --coverage",
"test-only": "jest",
"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"
"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-build",
"tsc-build": "tsc --project tsconfig.build.json"
},
"dependencies": {
"cheminfo-types": "^1.8.1",
"ml-matrix": "^6.12.1",
"ml-spectra-processing": "^14.18.0"
},
"devDependencies": {
"@types/node": "^24.9.1",
"@vitest/coverage-v8": "^3.2.4",
"@zakodium/tsconfig": "^1.0.2",
"eslint": "^8.57.0",
"eslint-config-cheminfo-typescript": "^12.2.0",
"jest-matcher-deep-close-to": "^3.0.2",
"prettier": "^3.6.2",
"rimraf": "^6.0.1",
"typescript": "^5.9.3",
"vitest": "^3.2.4"
},
"repository": {
"type": "git",
Expand All @@ -35,32 +50,5 @@
"bugs": {
"url": "https://github.com/mljs/linear-sum-assignment/issues"
},
"homepage": "https://github.com/mljs/linear-sum-assignment#readme",
"jest": {
"preset": "ts-jest",
"testEnvironment": "node"
},
"prettier": {
"arrowParens": "always",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
},
"dependencies": {
"cheminfo-types": "^1.7.3",
"ml-matrix": "^6.11.0",
"ml-spectra-processing": "^14.2.2"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"eslint": "^8.57.0",
"eslint-config-cheminfo-typescript": "^12.2.0",
"jest": "^29.7.0",
"jest-matcher-deep-close-to": "^3.0.2",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2"
}
"homepage": "https://github.com/mljs/linear-sum-assignment#readme"
}
6 changes: 2 additions & 4 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { toMatchCloseTo } from 'jest-matcher-deep-close-to';
import { describe, expect, it } from 'vitest';

import { linearSumAssignment } from '..';

expect.extend({ toMatchCloseTo });
import { linearSumAssignment } from '../index.ts';

describe('linear sum problem', () => {
it('same number of rows and columns', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/getShortestPath.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { DoubleArray } from 'cheminfo-types';
import type { DoubleArray } from 'cheminfo-types';
import type { Matrix } from 'ml-matrix';
import { xSequentialFillFromTo } from 'ml-spectra-processing';

interface GetShortestPathOptions {
export interface GetShortestPathOptions {
currUnAssCol: number;
dualVariableForColumns: DoubleArray;
dualVariableForRows: DoubleArray;
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DoubleArray } from 'cheminfo-types';
import type { DoubleArray } from 'cheminfo-types';
import { Matrix } from 'ml-matrix';

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

interface Options {
export interface LinearSumAssignmentOptions {
/**
* if true it will generate the assignment by the maximization of the cost.
* @default true
Expand All @@ -21,7 +21,7 @@ export function linearSumAssignment(
* Cost matrix
*/
input: DoubleArray[] | Matrix,
options: Options = {},
options: LinearSumAssignmentOptions = {},
) {
const { maximaze = true } = options;

Expand Down
5 changes: 5 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["**/__tests__", "**/*.test.*"]
}
9 changes: 0 additions & 9 deletions tsconfig.cjs.json

This file was deleted.

8 changes: 0 additions & 8 deletions tsconfig.esm.json

This file was deleted.

11 changes: 5 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "@zakodium/tsconfig",
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"inlineSourceMap": true,
"strict": true,
"target": "es2019"
"noUncheckedIndexedAccess": false,
"outDir": "lib",
"types": ["node"]
},
"include": ["./src/**/*"]
"include": ["src", "vite*.ts"]
}
10 changes: 10 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
coverage: {
include: ['src/**'],
},
setupFiles: ['vitest.setup.ts'],
},
});
4 changes: 4 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { toBeDeepCloseTo, toMatchCloseTo } from 'jest-matcher-deep-close-to';
import { expect } from 'vitest';

expect.extend({ toMatchCloseTo, toBeDeepCloseTo });