Skip to content

fix: create ND2 frame views with reshape - #302

Closed
stanbot8 wants to merge 2 commits into
tlambert03:mainfrom
stanbot8:fix/reshape-read-frame
Closed

fix: create ND2 frame views with reshape#302
stanbot8 wants to merge 2 commits into
tlambert03:mainfrom
stanbot8:fix/reshape-read-frame

Conversation

@stanbot8

@stanbot8 stanbot8 commented Jul 27, 2026

Copy link
Copy Markdown

ND2File.read_frame changes the returned array shape through attribute assignment. Create each ND2 frame view with reshape. This keeps frame creation on the supported NumPy array API and avoids the NumPy 2.5 deprecation. Closes #301. All tests pass.

@stanbot8
stanbot8 force-pushed the fix/reshape-read-frame branch from b298699 to 55c625a Compare July 27, 2026 05:44
Comment thread tests/test_reader.py
DATA = Path(__file__).parent / "data"


@pytest.mark.filterwarnings(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

thank you @stanbot8

I don't understand, however, why we're adding this filterwarnings here?
we already globally elevate warnings to errors, and your fix was sufficient, no?

@tlambert03

Copy link
Copy Markdown
Owner

thanks for the contrib. I had to do the same one-line fix in #298 in order to get it in, so this is redundant.

@tlambert03 tlambert03 closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

read_frame assigns to ndarray.shape, deprecated in NumPy 2.5 (scheduled removal)

2 participants