forrestbao / pyeeg

Python + EEG/MEG = PyEEG
GNU General Public License v3.0
242 stars 85 forks source link

issue after running $ python setup.py test #37

Open Sari275 opened 6 months ago

Sari275 commented 6 months ago

Seeing below issue. Has anybody seen this issue before with largest_lyauponov_exponent.py after running "$ python setup.py test" and would be able to share a solution if one was found? I haven't been able to figure it out..

largest_lyauponov_exponent.py:119: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1. [m, c] = numpy.linalg.lstsq(X, mean_d)[0] FAIL test_permutation_entropy (tests.test_permutation_entropy.PermutationEntropyTests.test_permutation_entropy) ... ok test_sampen_against_original_c_test_data (tests.test_sampen.SampEnTests.test_sampen_against_original_c_test_data) Use test data from ... ok test_sampen_against_predictable_sequence (tests.test_sampen.SampEnTests.test_sampen_against_predictable_sequence) ... ok

====================================================================== FAIL: test_largest_lyauponov_exponent (tests.test_largest_lyauponov_exponent.LLETests.test_largest_lyauponov_exponent)

\pyeeg\tests\test_largest_lyauponov_exponent.py", line 11, in test_largest_lyauponov_exponent self.assertAlmostEqual( AssertionError: nan != 0.18771136179353307 within 12 places (nan difference)


Ran 8 tests in 1.857s

FAILED (failures=1) Test failed: error: Test failed:

Zq5437 commented 6 months ago

38

Hello ! Here is the way I solve this problem . I encountered the same problem before long and I find that there might have something error in the process of " 0. ". Because the " log(0.) " equals -INF , which results in the nans we saw. After slight change , the output is 0.18771136179353343 ,which is quite close to the expected number 0.18771136179353307 (Because the same number of digits has exceeded 12, there will be no more errors reported here) Hopefully ,this might be useful for you ! Any question is expected. Zq