ecopy icon indicating copy to clipboard operation
ecopy copied to clipboard

CCA on varespec data example doesn't work (IndexError), and other small issues...

Open luuuuuuuke opened this issue 2 years ago • 0 comments

First, when trying to run the CCA example in the documentation, I get an index error.

`from scipy.special import comb import scipy.misc scipy.misc.comb = comb import ecopy as ep

varespec = ep.load_data('varespec') varechem = ep.load_data('varechem')

cca_fit = ep.cca(varespec, varechem) CCA.triplot()`

Traceback (most recent call last): File "", line 1, in File "C:\Program Files\JetBrains\PyCharm 2021.2.3\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2021.2.3\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/luke.mckay/AppData/Roaming/JetBrains/PyCharm2021.2/scratches/scratch_9.py", line 10, in cca_fit = ep.cca(varespec, varechem) File "C:\LT-docs\LT-repos\lt-lactate-dynamics\venv\lib\site-packages\ecopy\matrix_comp\cca.py", line 144, in init self.U = self.U[:,self.evals>tolerance] IndexError: boolean index did not match indexed array along dimension 1; dimension is 44 but corresponding boolean dimension is 14

Second, in the final line of code "CCA.triplot()" nothing has been defined as "CCA". Should this instead be "ep.cca.triplot()"? If so, I still get the same error above for the second to last line (cca_fit).

Any ideas what's going on here?

luuuuuuuke avatar Dec 23 '21 15:12 luuuuuuuke