From a498858f68b0f900fdfec1de666838f45bdc0be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 16 Oct 2024 17:43:15 +0200 Subject: [PATCH] feat: update dependencies Also fixes the build. --- eslint.config.mjs | 11 +++++++++ package.json | 27 ++++++++++++----------- src/index.js | 14 ++++++------ src/regression/kernel-ridge-regression.js | 4 ++-- src/regression/poly-fit-regression2d.js | 4 ++-- src/regression/potential-regression.js | 4 ++-- 6 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..5a7de17 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,11 @@ +import cheminfo from "eslint-config-cheminfo/base"; +import globals from "globals"; + +export default [ + ...cheminfo, + { + languageOptions: { + globals: { ...globals.jest }, + }, + }, +]; diff --git a/package.json b/package.json index d8889c3..dbc2510 100644 --- a/package.json +++ b/package.json @@ -41,24 +41,25 @@ "testEnvironment": "node" }, "devDependencies": { - "@babel/plugin-transform-modules-commonjs": "^7.24.1", - "@types/jest": "^29.5.12", - "eslint": "^8.57.0", - "eslint-config-cheminfo": "^9.2.0", + "@babel/plugin-transform-modules-commonjs": "^7.25.7", + "@types/jest": "^29.5.13", + "eslint": "^9.12.0", + "eslint-config-cheminfo": "^12.0.1", + "globals": "^15.11.0", "jest": "^29.7.0", - "prettier": "^3.2.5", - "rollup": "^4.17.2" + "prettier": "^3.3.3", + "rollup": "^4.24.0" }, "dependencies": { "ml-kernel": "^3.0.0", - "ml-matrix": "^6.11.0", - "ml-regression-base": "^3.0.0", - "ml-regression-exponential": "^2.1.0", + "ml-matrix": "^6.12.0", + "ml-regression-base": "^4.0.0", + "ml-regression-exponential": "^3.0.1", "ml-regression-multivariate-linear": "^2.0.4", - "ml-regression-polynomial": "^3.0.0", - "ml-regression-power": "^2.0.0", + "ml-regression-polynomial": "^3.0.1", + "ml-regression-power": "^3.0.0", "ml-regression-robust-polynomial": "^3.0.0", - "ml-regression-simple-linear": "^3.0.0", - "ml-regression-theil-sen": "^2.0.0" + "ml-regression-simple-linear": "^3.0.1", + "ml-regression-theil-sen": "^3.0.0" } } diff --git a/src/index.js b/src/index.js index 2001161..ad037b9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,12 @@ -import PotentialRegression from "./regression/potential-regression"; +import { PotentialRegression } from "./regression/potential-regression"; export { SimpleLinearRegression, SimpleLinearRegression as SLR, } from "ml-regression-simple-linear"; export { PolynomialRegression } from "ml-regression-polynomial"; -export { default as ExponentialRegression } from "ml-regression-exponential"; -export { default as PowerRegression } from "ml-regression-power"; +export { ExponentialRegression } from "ml-regression-exponential"; +export { PowerRegression } from "ml-regression-power"; export { default as MultivariateLinearRegression } from "ml-regression-multivariate-linear"; const NLR = { PotentialRegression, @@ -14,11 +14,11 @@ const NLR = { export { NLR, NLR as NonLinearRegression }; export { - default as KernelRidgeRegression, - default as KRR, + KernelRidgeRegression, + KernelRidgeRegression as KRR, } from "./regression/kernel-ridge-regression"; -export { default as PolinomialFitting2D } from "./regression/poly-fit-regression2d"; +export { PolynomialFitRegression2D as PolinomialFitting2D } from "./regression/poly-fit-regression2d"; // robust regressions -export { default as TheilSenRegression } from "ml-regression-theil-sen"; +export { TheilSenRegression } from "ml-regression-theil-sen"; export { RobustPolynomialRegression } from "ml-regression-robust-polynomial"; diff --git a/src/regression/kernel-ridge-regression.js b/src/regression/kernel-ridge-regression.js index 846acf1..4766e3e 100644 --- a/src/regression/kernel-ridge-regression.js +++ b/src/regression/kernel-ridge-regression.js @@ -1,6 +1,6 @@ import Kernel from "ml-kernel"; import { Matrix, solve } from "ml-matrix"; -import BaseRegression from "ml-regression-base"; +import { BaseRegression } from "ml-regression-base"; const defaultOptions = { lambda: 0.1, @@ -11,7 +11,7 @@ const defaultOptions = { // Implements the Kernel ridge regression algorithm. // http://www.ics.uci.edu/~welling/classnotes/papers_class/Kernel-Ridge.pdf -export default class KernelRidgeRegression extends BaseRegression { +export class KernelRidgeRegression extends BaseRegression { constructor(inputs, outputs, options) { super(); if (inputs === true) { diff --git a/src/regression/poly-fit-regression2d.js b/src/regression/poly-fit-regression2d.js index 2784ca3..13870e3 100644 --- a/src/regression/poly-fit-regression2d.js +++ b/src/regression/poly-fit-regression2d.js @@ -1,12 +1,12 @@ import { Matrix, SVD } from "ml-matrix"; -import BaseRegression from "ml-regression-base"; +import { BaseRegression } from "ml-regression-base"; const defaultOptions = { order: 2, }; // Implements the Kernel ridge regression algorithm. // http://www.ics.uci.edu/~welling/classnotes/papers_class/Kernel-Ridge.pdf -export default class PolynomialFitRegression2D extends BaseRegression { +export class PolynomialFitRegression2D extends BaseRegression { /** * Constructor for the 2D polynomial fitting * diff --git a/src/regression/potential-regression.js b/src/regression/potential-regression.js index 1d27a45..7a5e705 100644 --- a/src/regression/potential-regression.js +++ b/src/regression/potential-regression.js @@ -1,4 +1,4 @@ -import BaseRegression, { maybeToPrecision } from "ml-regression-base"; +import { BaseRegression, maybeToPrecision } from "ml-regression-base"; import { PolynomialRegression } from "ml-regression-polynomial"; /* @@ -10,7 +10,7 @@ import { PolynomialRegression } from "ml-regression-polynomial"; * @param {Number} M - The exponent of the potential fit. * @return {Number} A - The A coefficient of the potential fit. */ -export default class PotentialRegression extends BaseRegression { +export class PotentialRegression extends BaseRegression { /** * @constructor * @param x: Independent variable