diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c0dae18..e4c6ffea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,6 +81,7 @@ jobs: curl https://raw.githubusercontent.com/mne-tools/mne-python/main/tools/circleci_dependencies.sh -o circleci_dependencies.sh chmod +x circleci_dependencies.sh ./circleci_dependencies.sh + pip install -r requirements_doc.txt - save_cache: key: pip-cache diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0306a011..f6d2965e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -44,7 +44,7 @@ jobs: include: # An old one - os: ubuntu-latest - python-version: "3.8" + python-version: "3.9" steps: - uses: actions/checkout@v4 - uses: pyvista/setup-headless-display-action@main @@ -103,7 +103,7 @@ jobs: matrix: include: - os: ubuntu-latest - python-version: "3.8" + python-version: "3.9" mne-version: mne-main - os: ubuntu-latest python-version: "3.11" diff --git a/mne_connectivity/envelope.py b/mne_connectivity/envelope.py index c9eac9c6..3d2e8eb3 100644 --- a/mne_connectivity/envelope.py +++ b/mne_connectivity/envelope.py @@ -5,6 +5,8 @@ # # License: BSD (3-clause) +import inspect + import numpy as np from mne import BaseEpochs from mne.filter import next_fast_len @@ -100,7 +102,11 @@ def envelope_correlation(data, names=None, data.add_annotations_to_metadata(overwrite=True) metadata = data.metadata # get the actual data in numpy - data = data.get_data() + # XXX: remove logic once support for mne<1.6 is dropped + kwargs = dict() + if "copy" in inspect.getfullargspec(data.get_data).kwonlyargs: + kwargs["copy"] = False + data = data.get_data(**kwargs) else: metadata = None diff --git a/mne_connectivity/spectral/epochs.py b/mne_connectivity/spectral/epochs.py index f4899e87..fe66fdcf 100644 --- a/mne_connectivity/spectral/epochs.py +++ b/mne_connectivity/spectral/epochs.py @@ -201,7 +201,11 @@ def _check_rank_input(rank, data, indices): rank = np.zeros((2, len(indices[0])), dtype=int) if isinstance(data, BaseEpochs): - data_arr = data.get_data() + # XXX: remove logic once support for mne<1.6 is dropped + kwargs = dict() + if "copy" in inspect.getfullargspec(data.get_data).kwonlyargs: + kwargs["copy"] = False + data_arr = data.get_data(**kwargs) else: data_arr = data diff --git a/mne_connectivity/spectral/time.py b/mne_connectivity/spectral/time.py index 07dc4e57..106d4278 100644 --- a/mne_connectivity/spectral/time.py +++ b/mne_connectivity/spectral/time.py @@ -4,6 +4,8 @@ # # License: BSD (3-clause) +import inspect + import numpy as np import xarray as xr from mne.epochs import BaseEpochs @@ -325,7 +327,6 @@ def spectral_connectivity_time(data, freqs, method='coh', average=False, sfreq = data.info['sfreq'] events = data.events event_id = data.event_id - n_epochs, n_signals, n_times = data.get_data().shape # Extract metadata from the Epochs data structure. # Make Annotations persist through by adding them to the metadata. metadata = data.metadata @@ -338,7 +339,12 @@ def spectral_connectivity_time(data, freqs, method='coh', average=False, if hasattr(data, 'annotations') and not annots_in_metadata: data.add_annotations_to_metadata(overwrite=True) metadata = data.metadata - data = data.get_data() + # XXX: remove logic once support for mne<1.6 is dropped + kwargs = dict() + if "copy" in inspect.getfullargspec(data.get_data).kwonlyargs: + kwargs["copy"] = False + data = data.get_data(**kwargs) + n_epochs, n_signals, n_times = data.shape else: data = np.asarray(data) n_epochs, n_signals, n_times = data.shape diff --git a/mne_connectivity/vector_ar/var.py b/mne_connectivity/vector_ar/var.py index d6598311..dd75b7b8 100644 --- a/mne_connectivity/vector_ar/var.py +++ b/mne_connectivity/vector_ar/var.py @@ -1,3 +1,5 @@ +import inspect + import numpy as np import scipy from scipy.linalg import sqrtm @@ -144,7 +146,12 @@ def vector_auto_regression( metadata = data.metadata # get the actual data in numpy - data = data.get_data() + # get the actual data in numpy + # XXX: remove logic once support for mne<1.6 is dropped + kwargs = dict() + if "copy" in inspect.getfullargspec(data.get_data).kwonlyargs: + kwargs["copy"] = False + data = data.get_data(**kwargs) else: metadata = None diff --git a/requirements_doc.txt b/requirements_doc.txt index 34ba96cc..96b26066 100644 --- a/requirements_doc.txt +++ b/requirements_doc.txt @@ -12,4 +12,6 @@ sphinx-autodoc-typehints sphinxcontrib-bibtex git+https://github.com/mne-tools/mne-bids@main pooch -mne-qt-browser \ No newline at end of file +mne-qt-browser +PyQt6 +pyvistaqt \ No newline at end of file