Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix mlab fallback for 32-bit systems#30273

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
QuLogic wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromQuLogic:mlab32

Conversation

QuLogic
Copy link
Member

PR summary

Unfortunately, I applied the change from
#29115 (comment) directly without noticing the typo, or running full tests.

So fix the swapped condition, and add a test (forcsd only, which should be enough since everything goes though_spectral_helper.) This test should work on 64-bit systems as well, but I also double-checked on WASM.

PR checklist


if n == 1 and noverlap == 0:
return x[np.newaxis]
f'with noverlap < n and n <= x.size ({x.size})')
Copy link
Contributor

@anntzeranntzerJul 9, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Given that I had read the original check wrong, this can be further simplified to something likeif not 0 <= noverlap < n <= x.size: raise ValueError(f"n ({n}), noverlap ({noverlap}), and x.size ({x.size}) must satisfy 0 <= noverlap < n <= x.size")
Sorry for the very piecemeal review.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hmm, technically,noverlap doesn't need to be non-negative in the non-fallback/64-bit case. Maybe we should move this check up there earlier?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good point that noverlap can be negative here. Probably the semantically meaningful check should be to replace, in _spectral_helper, erroring whennoverlap >= NFFT by erroring whennot 0 <= noverlap < NFFT.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Did that then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wasn't your point that _stride_windows doesn't require anything regarding noverlap and only requires 0 < n <= x.size (so the test in _stride_windows still needs to be relaxed), whereas _spectral_helper requires 0 <= noverlap < NFFT (which you have correctly changed?)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Well,_stride_windows is only called by_spectral_helper in the 32-bit case, and no other functions do. So I guess it doesn't matter much, and it can be dropped here.

@QuLogicQuLogicforce-pushed themlab32 branch 2 times, most recently fromb68335d toa5c273bCompareJuly 12, 2025 03:51
Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Still a minor point (#30273 (comment)) but it's not crucial and can be simplified later.

Unfortunately, I applied the change frommatplotlib#29115 (comment)directly without noticing the typo, or running full tests.So fix the swapped condition, and add a test (for `csd` only, whichshould be enough since everything goes though `_spectral_helper`.)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

3 participants
@QuLogic@anntzer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp