From df1321839b53fa5fc586bddaa92b98dc23c96277 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 22 Aug 2023 10:16:11 -0400 Subject: [PATCH] MAINT: Use explicitly public APIs (#145) --- mne_connectivity/conftest.py | 2 ++ mne_connectivity/spectral/tests/test_spectral.py | 5 ++++- mne_connectivity/tests/test_connectivity.py | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mne_connectivity/conftest.py b/mne_connectivity/conftest.py index db908b67..db11be17 100644 --- a/mne_connectivity/conftest.py +++ b/mne_connectivity/conftest.py @@ -36,6 +36,8 @@ def pytest_configure(config): # imageio-ffmpeg (still happening as of version 0.4.8): ignore:pkg_resources is deprecated as an API:DeprecationWarning ignore:Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning + # HDF5 + ignore:`product` is deprecated as of NumPy.*:DeprecationWarning """ # noqa: E501 for warning_line in warning_lines.split('\n'): warning_line = warning_line.strip() diff --git a/mne_connectivity/spectral/tests/test_spectral.py b/mne_connectivity/spectral/tests/test_spectral.py index fa8cf44d..c8f6ab23 100644 --- a/mne_connectivity/spectral/tests/test_spectral.py +++ b/mne_connectivity/spectral/tests/test_spectral.py @@ -144,7 +144,10 @@ def test_spectral_connectivity_parallel(method, mode, tmp_path): read_con = read_connectivity(tmp_file) assert_array_almost_equal(con.get_data(), read_con.get_data()) - assert repr(con) == repr(read_con) + # split `repr` before the file size (`~23 kB` for example) + a = repr(con).split('~')[0] + b = repr(read_con).split('~')[0] + assert a == b @pytest.mark.parametrize('method', ['coh', 'cohy', 'imcoh', 'plv', diff --git a/mne_connectivity/tests/test_connectivity.py b/mne_connectivity/tests/test_connectivity.py index 59563943..cfd6459c 100644 --- a/mne_connectivity/tests/test_connectivity.py +++ b/mne_connectivity/tests/test_connectivity.py @@ -5,14 +5,13 @@ import os from mne.annotations import Annotations from mne.epochs import BaseEpochs -from mne.io.meas_info import create_info import numpy as np import pandas as pd import pytest from numpy.testing import assert_array_equal from mne.io import RawArray -from mne import make_fixed_length_epochs +from mne import make_fixed_length_epochs, create_info from mne_connectivity import (Connectivity, EpochConnectivity, EpochSpectralConnectivity,