neurodata / mgcpy-old

MGCPY WILL NO LONGER BE UPDATED. THE NEW REPO CAN BE FOUND HERE:
https://github.com/neurodata/hyppo
Apache License 2.0
31 stars 45 forks source link

error importing compute_distance_matrix on MDMR demo notebook #144

Closed jrasero closed 5 years ago

jrasero commented 5 years ago

Hi,

In the first cell of the MDMR demo notebook, I tried to import "compute_distance_matrix" function, but it didn't work. There is a module called in the same way within the "utils" module, but it is not a function and therefore, if you try to import it and use it later as an argument when using MDMR in the following cell, it also gives rise to an error. Could you please check it?

sampan501 commented 5 years ago

Have you upgraded to the latest version of mgcpy? We recently reformatted the package and so older versions of the code may have compute_distance_matrix incorrectly placed. You can upgrade the package through pip using: pip install --upgrade mgcpy If this does not work, can you please post the error output?

jrasero commented 5 years ago

Hi,

upgrading did not work. This is the output:

cannot import name 'compute_distance_matrix' from 'mgcpy.independence_tests.utils.mdmr_functions'

It seems that it fails to find that function. Indeed, in the current repository, which I guess it is the newest one, there's no compute_distance_matrix function inside mdmr_functions module

sampan501 commented 5 years ago

I have found a fix that will also be updated in the next version of the package. A fix, for now, is to remove the following line: from mgcpy.independence_tests.utils.compute_distance_matrix import compute_distance and whenever the MDMR object is created in the tutorial as in the following line, just remove the compute_distance_matrix variable: mdmr = MDMR() instead of mdmr = MDMR(compute_distance_matrix) Please let me know if that fixed the issue

sampan501 commented 5 years ago

https://github.com/neurodata/mgcpy/pull/129/commits/be2d4694638b886e31b80da7b89dd63a4aa83660

jrasero commented 5 years ago

Thanks! That fixed the issue.