-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] (Re)implement complex data support for Spectrum
and SpectrumArray
classes
#12747
Conversation
for more information, see https://pre-commit.ci
Will add a changelog entry when the extent of the changes being made is clearer. |
Couple failures for the |
If you want you can ignore them here. It looks unrelated to your changes. I can open a quick PR to fix them unless you're already on it! |
Oh wait they are related... I was looking into it anyway so pushed a tiny fix, but feel free to force-push over it if you have a better one |
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 looks pretty good! See my inline comments. Regarding this:
I can't take much credit for this since it's mainly re-implementing the work of others, so big thanks to the original authors @drammock @larsoner @alexrockhill!
I suggest adding those three as co-authors on at least one commit (adding them on 0d8d09c would have made the most sense, but in the end we squash-merge so it won't matter, any commit will do).
Co-authored-by: Daniel McCloy <[email protected]>
for more information, see https://pre-commit.ci
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 looks great! One small comment.
Very xarray
esque. Maybe long term might be worth adding as a dependency or making a simple class with data and dimension names with helpers but this doesn't seem too brittle without that so no need right now in my opinion.
Okay, have included version info for new params/attrs. I also updated the Notes section of the array classes to reflect the changes in this PR: Lines 2924 to 2934 in 7badfbf
Before it explicitly suggested against pasing in coeffs. It also suggested passing in e.g. amplitude or phase data could have unintended consequences beyond incorrect axis labels, however having gone through the code I don't see what these other effects could be. It's just the typical Personally I don't think the docs need to be so cautious. |
Sorry, realised some of my docs formatting was inconsistent with MNE conventions so have fixed now. |
I think the previous caution was reflecting "besides axis labels, we haven't thought carefully about what else might break if you pass ampl. instead of power". Since you've now read through the code and not found anything, I think your less stern warning is fine. |
circleCI error is unrelated: looks like TownCrier can't handle Sphinx 7.4.7 ? Or maybe it's a transient thing 🤷 |
@tsbinns maybe now if you add a changelog entry, the towncrier failure will magically go away :) |
Unfortunately not... |
Looks like sphinx-contrib/sphinxcontrib-towncrier#92 I'll add a pin |
@tsbinns is this ready to go in? |
@drammock Just had a look back over and yes, seems like everything has been addressed! |
Damn, that one test for Win 3.10 just ran over the time limit, but I don't have permission to re-run. |
Restarted! |
Reference issue
Addresses #12728 & discussed in chat with @larsoner & @drammock
What does this implement/fix?
Idea is to:
(Epochs)Spectrum
classes present before MAINT: Post-release deprecations #12265(Epochs)SpectrumArray
classes which was a WIP in [ENH, MRG] Add EpochsSpectrumArray and SpectrumArray classes #11803 before decision to drop support was madeoutput="complex"
as a kwarg incompute_psd()
methods to bring API in line withcompute_tfr()
(@drammock this wasn't much more work beyond the other constructor changes)As I understand, the decision to initially drop support was that complex coeff support does increase the complexity of the code somewhat and the use-cases perhaps weren't so clear. However, we would like to make some changes in MNE-Connectivity where having
Spectrum
objects support coefficients would be really useful (in addition to some uses mentioned in #11803).Will include some comments for particular changes below. Also very open to discussion/suggestions.
Additional information
I can't take much credit for this since it's mainly re-implementing the work of others, so big thanks to the original authors @drammock @larsoner @alexrockhill!