From 0b8d2af15e780e4e4debcf63ee01adbd1196c04a Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Fri, 24 May 2024 18:04:31 +0200 Subject: [PATCH] [MAINT] Add logic for handling AverageTFRArray in old MNE versions (#185) Co-authored-by: Eric Larson --- examples/cwt_sensor_connectivity.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/cwt_sensor_connectivity.py b/examples/cwt_sensor_connectivity.py index 7647c637..c7b5947b 100644 --- a/examples/cwt_sensor_connectivity.py +++ b/examples/cwt_sensor_connectivity.py @@ -8,6 +8,7 @@ domain using Morlet wavelets and the debiased squared weighted phase lag index :footcite:`VinckEtAl2011` is used as connectivity metric. """ + # Author: Martin Luessi # # License: BSD (3-clause) @@ -18,7 +19,7 @@ import numpy as np from mne import io from mne.datasets import sample -from mne.time_frequency import AverageTFR +from mne.time_frequency import AverageTFRArray from mne_connectivity import seed_target_indices, spectral_connectivity_epochs @@ -92,7 +93,8 @@ layout = mne.find_layout(epochs.info, "meg") # use full layout -tfr = AverageTFR(epochs.info, con.get_data(), times, freqs, len(epochs)) +# Note that users of mne < 1.7 should use the `AverageTFR` class +tfr = AverageTFRArray(epochs.info, con.get_data(), times, freqs, nave=len(epochs)) tfr.plot_topo(fig_facecolor="w", font_color="k", border="k")