#9 Update to 1.2.1 and backport patch for ppc64le/aarch64 test failures
Merged 2 years ago by music. Opened 2 years ago by music.
rpms/ music/python-mne v1.2.1  into  rawhide

file modified
+1
@@ -15,3 +15,4 @@ 

  /python-mne-0.24.1.tar.gz

  /python-mne-1.0.3.tar.gz

  /python-mne-1.2.0.tar.gz

+ /python-mne-1.2.1.tar.gz

@@ -0,0 +1,86 @@ 

+ From 24e7e3e0ebe41aa27f31b0d97c1d761479c19dad Mon Sep 17 00:00:00 2001

+ From: Eric Larson <larson.eric.d@gmail.com>

+ Date: Fri, 28 Oct 2022 11:53:49 -0400

+ Subject: [PATCH] BUG: Work around ppc64le bugs (#11284)

+ 

+ ---

+  azure-pipelines.yml                  | 2 +-

+  mne/inverse_sparse/mxne_optim.py     | 2 +-

+  mne/time_frequency/tests/test_tfr.py | 2 ++

+  mne/time_frequency/tfr.py            | 7 ++++++-

+  requirements.txt                     | 2 +-

+  5 files changed, 11 insertions(+), 4 deletions(-)

+ 

+ diff --git a/azure-pipelines.yml b/azure-pipelines.yml

+ index ee96d030a..08970b3dc 100644

+ --- a/azure-pipelines.yml

+ +++ b/azure-pipelines.yml

+ @@ -116,7 +116,7 @@ stages:

+      - bash: |

+          set -e

+          python -m pip install --progress-bar off --upgrade pip setuptools wheel codecov

+ -        python -m pip install --progress-bar off mne-qt-browser[opengl] pyvista scikit-learn pytest-error-for-skips python-picard "PySide6!=6.3.0,!=6.4.0" qtpy

+ +        python -m pip install --progress-bar off mne-qt-browser[opengl] pyvista scikit-learn pytest-error-for-skips python-picard "PySide6!=6.3.0,!=6.4.0,!=6.4.0.1" qtpy

+          python -m pip uninstall -yq mne

+          python -m pip install --progress-bar off --upgrade -e .[test]

+        displayName: 'Install dependencies with pip'

+ diff --git a/mne/inverse_sparse/mxne_optim.py b/mne/inverse_sparse/mxne_optim.py

+ index 8b7f342b5..587f17444 100644

+ --- a/mne/inverse_sparse/mxne_optim.py

+ +++ b/mne/inverse_sparse/mxne_optim.py

+ @@ -225,7 +225,7 @@ def _mixed_norm_solver_bcd(M, G, alpha, lipschitz_constant, maxit=200,

+                  # equivalent to:

+                  # z = np.linalg.solve(C, np.ones(K))

+                  u, s, _ = np.linalg.svd(C, hermitian=True)

+ -                if s[-1] <= 1e-6 * s[0]:

+ +                if s[-1] <= 1e-6 * s[0] or not np.isfinite(s).all():

+                      logger.debug("Iteration %d: LinAlg Error" % (i + 1))

+                      continue

+                  z = ((u * 1 / s) @ u.T).sum(0)

+ diff --git a/mne/time_frequency/tests/test_tfr.py b/mne/time_frequency/tests/test_tfr.py

+ index 57feb97ca..c626e9058 100644

+ --- a/mne/time_frequency/tests/test_tfr.py

+ +++ b/mne/time_frequency/tests/test_tfr.py

+ @@ -99,6 +99,8 @@ def test_time_frequency():

+          tfr_morlet(epochs_nopicks,

+                     freqs=freqs, n_cycles=n_cycles, use_fft=True,

+                     return_itc=False, picks=picks, average=False)

+ +    assert_allclose(

+ +        epochs_power_picks.data[0, 0, 0, 0], 9.130315e-23, rtol=1e-4)

+      power_picks_avg = epochs_power_picks.average()

+      # the actual data arrays here are equivalent, too...

+      assert_allclose(power.data, power_picks.data)

+ diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py

+ index ce1c008ff..912e40f8c 100644

+ --- a/mne/time_frequency/tfr.py

+ +++ b/mne/time_frequency/tfr.py

+ @@ -248,7 +248,12 @@ def _cwt_gen(X, Ws, *, fsize=0, mode="same", decim=1, use_fft=True):

+              if use_fft:

+                  ret = ifft(fft_x * fft_Ws[ii])[:n_times + W.size - 1]

+              else:

+ -                ret = np.convolve(x, W, mode=mode)

+ +                # Work around multarray.correlate->OpenBLAS bug on ppc64le

+ +                # ret = np.correlate(x, W, mode=mode)

+ +                ret = (

+ +                    np.convolve(x, W.real, mode=mode) +

+ +                    1j * np.convolve(x, W.imag, mode=mode)

+ +                )

+  

+              # Center and decimate decomposition

+              if mode == 'valid':

+ diff --git a/requirements.txt b/requirements.txt

+ index f666856bc..20da23a48 100644

+ --- a/requirements.txt

+ +++ b/requirements.txt

+ @@ -9,7 +9,7 @@ h5io

+  packaging

+  pymatreader

+  qtpy

+ -PySide6!=6.3.0,!=6.4.0  # incompat with Matplotlib 3.6.1

+ +PySide6!=6.3.0,!=6.4.0,!=6.4.0.1  # incompat with Matplotlib 3.6.1 and qtpy

+  pyobjc-framework-Cocoa>=5.2.0; platform_system=="Darwin"

+  sip

+  scikit-learn

+ -- 

+ 2.37.3

+ 

file modified
+9 -10
@@ -5,7 +5,7 @@ 

  # in setup.py for install_requires.

  

  Name:           python-mne

- Version:        1.2.0

+ Version:        1.2.1

  Release:        %autorelease

  Summary:        Magnetoencephalography (MEG) and Electroencephalography (EEG) data analysis

  
@@ -21,6 +21,12 @@ 

  # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval

  ExcludeArch:    %{ix86}

  

+ # BUG: Work around ppc64le bugs

+ # https://github.com/mne-tools/mne-python/pull/11284

+ #

+ # Rebased on 1.2.1

+ Patch:          0001-BUG-Work-around-ppc64le-bugs-11284.patch

+ 

  # The combination of an arched package with only noarch binary packages makes

  # it easier for us to detect arch-dependent test failures, since the tests will

  # always be run on every platform, and easier for us to skip failing tests if
@@ -109,7 +115,7 @@ 

  %description -n python3-mne %_description

  

  %prep

- %autosetup -n mne-python-%{version}

+ %autosetup -n mne-python-%{version} -p1

  

  # fix non-executable scripts

  sed -i -e '1{\@^#!/usr/bin/env python@d}' mne/commands/*.py
@@ -145,16 +151,9 @@ 

  # required for some tests

  mkdir subjects

  

- # One test failure on aarch64

- # https://github.com/mne-tools/mne-python/issues/10984

- k="${k-}${k+ and }not test_mxne_inverse_sure_synthetic[3-0.75-4-20-60-20]"

- # Two test failures on ppc64le

- # https://github.com/mne-tools/mne-python/issues/10985

- k="${k-}${k+ and }not test_csd_morlet"

- k="${k-}${k+ and }not test_time_frequency"

  # https://github.com/mne-tools/mne-python/blob/v1.0.3/tools/github_actions_test.sh#L7

  # skip tests that require network

- %pytest -k "${k-}" -m "not (slowtest or pgtest)" \

+ %pytest -m "not (slowtest or pgtest)" \

      --deselect mne/datasets/tests/test_datasets.py \

      --deselect mne/utils/tests/test_numerics.py

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (python-mne-1.2.0.tar.gz) = e5b36d298d27e13bc5edff28e8f30c72fc98d0ce6e38352e6a9264365421c89e7cd69213398d441d107c98423c8e71104442a1bb980b200c4bc49630d181b4c4

+ SHA512 (python-mne-1.2.1.tar.gz) = 9455a0c952803793b96637ebabe35471ed07357e907e21d08fc390f052c1dad452b0577cceaad994961d788298d74f731c6c20d75137328309047c69052e5017