neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.53k stars 407 forks source link

Functions using SciPy’s linear algebra fail after Windows 10 update to 2004 #386

Closed Tam-Pham closed 3 years ago

Tam-Pham commented 3 years ago

Example:

import neurokit2 as nk
data = nk.data("bio_resting_5min_100hz")
df, info = nk.bio_process(ecg=data["ECG"], rsp=data["RSP"], sampling_rate=100)
nk.bio_analyze(df, sampling_rate=100)

Error:

>>> nk.bio_analyze(df, sampling_rate=100) #doctest: +ELLIPSIS
Traceback (most recent call last):

  File "<ipython-input-4-314ffedb42a6>", line 1, in <module>
    nk.bio_analyze(df, sampling_rate=100) #doctest: +ELLIPSIS

  File "C:\Users\Pham Thanh Tam\Dropbox\GitHub\NeuroKit\neurokit2\bio\bio_analyze.py", line 158, in bio_analyze
    rsa = _bio_analyze_rsa_interval(data, sampling_rate=sampling_rate)

  File "C:\Users\Pham Thanh Tam\Dropbox\GitHub\NeuroKit\neurokit2\bio\bio_analyze.py", line 195, in _bio_analyze_rsa_interval
    rsa = hrv_rsa(data, sampling_rate=sampling_rate, continuous=False)

  File "C:\Users\Pham Thanh Tam\Dropbox\GitHub\NeuroKit\neurokit2\hrv\hrv_rsa.py", line 176, in hrv_rsa
    window=window, window_number=window_number, continuous=continuous)

  File "C:\Users\Pham Thanh Tam\Dropbox\GitHub\NeuroKit\neurokit2\hrv\hrv_rsa.py", line 362, in _hrv_rsa_gates
    multipeak, weight = _get_multipeak_window(nperseg, window_number)

  File "C:\Users\Pham Thanh Tam\Dropbox\GitHub\NeuroKit\neurokit2\hrv\hrv_rsa.py", line 434, in _get_multipeak_window
    _, Q = scipy.linalg.schur(C)

  File "C:\Users\Pham Thanh Tam\Desktop\WPy-3710b\python-3.7.1.amd64\lib\site-packages\scipy\linalg\decomp_schur.py", line 173, in schur
    raise LinAlgError("Schur form not found.  Possibly ill-conditioned.")

LinAlgError: Schur form not found.  Possibly ill-conditioned.``

This error is apparently due to the fmod issue on Windows 2004. A more detailed discussion can be read in here

The bad news is MS replied in the VS forum and suggested that a fix could only be out by end of Jan 2021. We will follow the issue closely and make an update here about any potential work-around. For now, there is no work-around solution works yet.

stale[bot] commented 3 years ago

This issue has been automatically marked as inactive because it has not had recent activity. It will eventually be closed if no further activity occurs.

stale[bot] commented 3 years ago

This issue has been inactive for a long time. We're closing it (but feel free to reopen it if need be).