Fix n_fft_samples docstring: uses next_fast_len, not next power of 2#74
Merged
Conversation
Co-authored-by: edeno <8053989+edeno@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect multitaper docstring for n_fft_samples
Fix n_fft_samples docstring: uses next_fast_len, not next power of 2
Nov 1, 2025
emilyps14
approved these changes
Nov 2, 2025
edeno
approved these changes
Nov 3, 2025
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the documentation for the n_fft_samples parameter in the Multitaper class to provide more accurate and detailed information about how the FFT length is determined when not explicitly specified.
- Updated the
n_fft_samplesparameter description to clarify that it usesscipy.fft.next_fast_len(orcupy.fft.next_fast_lenfor GPU) instead of simply the next power of 2
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
Multitaperclass docstring incorrectly stated thatn_fft_samplesdefaults to "next power of 2 >= n_time_samples_per_window". The implementation actually usesscipy.fft.next_fast_len()(orcupy.fft.next_fast_len()for GPU), which returns an FFT-efficient length that may not be a power of 2.For example:
Changes
n_fft_samplesparameter docstring inMultitaper.__init__()to accurately describe the behavior:scipy.fft.next_fast_len/cupy.fft.next_fast_lenOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.