Skip to content

Commit

Permalink
[MAINT] Add logic for handling AverageTFRArray in old MNE versions (#185
Browse files Browse the repository at this point in the history
)

Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
tsbinns and larsoner authored May 24, 2024
1 parent 6955e80 commit 0b8d2af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/cwt_sensor_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
#
# License: BSD (3-clause)
Expand All @@ -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

Expand Down Expand Up @@ -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")


Expand Down

0 comments on commit 0b8d2af

Please sign in to comment.