You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tfr_array_stockwell data argument does not match the epoch_data argument of tfr_array_multitaper and _morlet functions #12305
All three of these functions state that the data must be of shape (n_epochs, n_channels, n_times), so it is clear that even for tfr_array_stockwell, data should be epoched, however this is not so clear from the Looking at the Time-Frequency module API.
I could see someone skimming the API thinking that tfr_array_multitaper and tfr_array_morlet must be performed on epoched data, but tfr_array_stockwell on raw or epoched data (given the different name of the data argument).
Possible solution
Changing data to epoch_data in tfr_array_stockwell would bring it in line with the other functions and make it clear from even the module API that the Stockwell function expects epoched data.
just to play devil's advocate for a moment, would it be better to change the other two functions' first param to data instead? To me it feels slightly better (because data as first param is a very common pattern, and not just for us). But I'm content to defer to @larsoner or others on this point
Activity
larsoner commentedon Dec 18, 2023
+1 for changing the name. It's very likely people mostly have exclusively used it positionally so doing
and emitting a
FutureWarningwhendata is not Noneshould be safe enough. @tsbinns up for opening a PR to do this?drammock commentedon Dec 18, 2023
just to play devil's advocate for a moment, would it be better to change the other two functions' first param to
datainstead? To me it feels slightly better (becausedataas first param is a very common pattern, and not just for us). But I'm content to defer to @larsoner or others on this pointlarsoner commentedon Dec 18, 2023
Works for me
tsbinns commentedon Dec 18, 2023
Okay, so switch the multitaper and Morlet functions to
dataand setepoch_data=Noneas default (raising aFutureWarningifepoch_data is not None)?Happy to open a PR for this, latest after the holidays. Cheers!
drammock commentedon Dec 18, 2023
yep! thanks.