Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Add option to store and return TFR taper weights #12910
base: main
Are you sure you want to change the base?
[ENH] Add option to store and return TFR taper weights #12910
Changes from 4 commits
9fe1fb6
45c6a0b
82fc2f7
9f30a59
a49f934
48afced
7c3dcfa
8c16716
51b8cd0
b4537b2
f155238
2a03e9b
045d9a2
8d645bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This I am somewhat unsure on. The existing implementation is to just use
conc
as-is, however in the MNE-Connectivity implementation that sqrt is taken: https://github.com/mne-tools/mne-connectivity/blob/97147a57eefb36a5c9680e539fdc6343a1183f20/mne_connectivity/spectral/time.py#L825There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also unsure on this point. We should ask @ruuskas (who wrote the implementation in MNE-Connectivity) and @larsoner (who wrote the SciPy DPSS implementation) to weigh in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but it can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hesitate to blindly overwrite what the user might have put into their
method_kw
dict, so I was going to suggest using.setdefault
here. But then I wondered, is there ever a case where the user would sensibly want to passmethod_kw=dict(return_weights=False, ...)
? I'm guessing not, since when instantiating the TFR class object, the user isn't getting direct access to the return value of the method anyway. WDYT @tsbinns ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was my line of thought as well. Also, allowing the user to control this would mean extra logic needs to be put in place when unpacking the tfr values (i.e., whether we need to separate the tfr from the weights). I think just forcing this to
True
simplifies things and would not affect the user at all.