mljs / matrix

Matrix manipulation and computation library
https://mljs.github.io/matrix/
MIT License
353 stars 54 forks source link

Issue with the last version #170

Closed lpatiny closed 10 months ago

lpatiny commented 11 months ago

I have a new issue with the last version of ml-matrix and another project that use cheminfo-build to create a the library 'MassTools'.

The following code works correctly using https://www.lactame.com/lib/mass-tools/7.19.1/mass-tools.js

With the last build that uses ml-matrix 6.10.6 I get the following error:

blockFcnnls.js:29 Uncaught (in promise) TypeError: Matrix$1 is not a constructor
    at blockFcnnls (blockFcnnls.js:29:15)
    at Object.mfsDeconvolution (mfsDeconvolution.js:79:38)
    at async doAll (index.html:13:23)
blockFcnnls @ blockFcnnls.js:29
(anonymous) @ index.html:18
<html>

<head>
  <script src="https://www.lactame.com/lib/mass-tools/7.20.0/mass-tools.js"></script>
</head>

<body>
  <script>
    async function doAll() {

      const spectrum = new MassTools.Spectrum({ x: [118.0862551, 119.0895773, 120.0928776], y: [100, 100, 100] });

      const { mfs } = await MassTools.MFSDeconvolution.mfsDeconvolution(spectrum, [
        'HValOH',
        '([13C]C-1)0-10',
      ]);
    }
    doAll()
  </script>
</body>

</html>
targos commented 11 months ago

I would recommend to upgrade Rollup (and its plugins) in cheminfo-tools before doing anything else. It's very outdated: https://github.com/cheminfo/tools/blob/master/packages/cheminfo-build/package.json

targos commented 10 months ago

Actually, this is probably the same issue that Hamed had and is fixed by https://github.com/mljs/matrix/commit/bc4ba151dcab5dc3c2cc0d4f1f326d541e44217f.

targos commented 10 months ago

I assume it's fixed.