File: up_check_numpy

package info (click to toggle)
python-mne 0.19.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 100,440 kB
  • sloc: python: 120,243; pascal: 1,861; makefile: 225; sh: 15
file content (27 lines) | stat: -rw-r--r-- 1,249 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Author: Yaroslav Halchenko
Last-Update: 2017-12-04 22:58:05 -0500
Description: Check for numpy version
FIXME: Is this patch needed any more in version 0.17?
Last-Update: 2019-09-01

--- a/mne/decoding/tests/test_receptive_field.py
+++ b/mne/decoding/tests/test_receptive_field.py
@@ -10,7 +10,7 @@ from numpy.testing import assert_array_e
 
 from mne import io, pick_types
 from mne.fixes import einsum, rfft, irfft
-from mne.utils import requires_version, requires_sklearn, run_tests_if_main
+from mne.utils import requires_version, requires_sklearn, run_tests_if_main, check_version
 from mne.decoding import ReceptiveField, TimeDelayingRidge
 from mne.decoding.receptive_field import (_delay_time_series, _SCORERS,
                                           _times_to_delays, _delays_to_slice)
@@ -521,6 +521,9 @@ def test_inverse_coef():
         rf = ReceptiveField(tmin, tmax, 1., estimator=estimator,
                             patterns=True)
         rf.fit(X, y)
+        # For some reason there is no warning
+        if estimator and not check_version('numpy', '1.13'):
+            continue
         inv_rf = ReceptiveField(tmin, tmax, 1., estimator=estimator,
                                 patterns=True)
         inv_rf.fit(y, X)