Closed tsbinns closed 4 months ago
Again some strange MacOS-specific runtime errors for code not touched by this PR like in #184.
Unrelated spelling mistake just now being caught with updated codespell version addressed in #186.
Looks like comments have been address so I'll mark for merge-when-green, thanks @tsbinns !
Problem
Since MNE-Python v1.7 the API of
time_frequency.AverageTFR
has been changed. The old API from <= v1.6 is now available in the new classtime_frequency.AverageTFRArray
.The example
cwt_sensor_connectivity.py
usesAverageTFR
with the old API, causing documentation building to fail when using MNE-Python >= v1.7.Solution
One possibility is to check whether the new class
AverageTFRArray
is available and import this (for >= v1.7), otherwise use the oldAverageTFR
(for v <= 1.6):https://github.com/mne-tools/mne-connectivity/blob/397d6d737a09ee976f8814c7ad90ded1ea9c8609/examples/cwt_sensor_connectivity.py#L19-L28
Also necessary to explicitly set the
nave
parameter, as the newAverageTFRArray
does not support this as a positional argument:https://github.com/mne-tools/mne-connectivity/blob/397d6d737a09ee976f8814c7ad90ded1ea9c8609/examples/cwt_sensor_connectivity.py#L100
Very open to other ideas for implementing such a logic. Cheers!