Skip to content

BUG: Allow reading non-npy files in npz and add test #29313

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

Merged
merged 7 commits into from
Jul 7, 2025
Merged

Conversation

DWesl
Copy link
Contributor

@DWesl DWesl commented Jul 2, 2025

Retrieving a from an npz file will first check for a file a, then for a.npy; this checks both.

Fixes #29282

Retrieving `a` from an npz file will first check for a file `a`, then for `a.npy`; this checks both.
seberg and others added 4 commits July 4, 2025 08:29
Otherwise it complains it isn't already a ZIP archive
Old behavior is to read everything, which will happen if I pass no argument.
@seberg seberg added 09 - Backport-Candidate PRs tagged should be backported 00 - Bug labels Jul 4, 2025
@seberg seberg added this to the 2.3.2 release milestone Jul 4, 2025
@seberg seberg marked this pull request as ready for review July 7, 2025 07:27
Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

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

Thanks for the follow up and test. I don't see a reason to still consider it a draft, let's get it in.

@seberg seberg merged commit 6a6b171 into numpy:main Jul 7, 2025
76 checks passed
@seberg seberg changed the title TST: Add test for non-npy files in npz and different names BUG: Allow reading non-npy files in npz and add test Jul 7, 2025
@DWesl DWesl deleted the patch-2 branch July 7, 2025 14:13
charris pushed a commit to charris/numpy that referenced this pull request Jul 22, 2025
* TST: Add test for non-npy files in npz and different names

Retrieving `a` from an npz file will first check for a file `a`, then for `a.npy`; this checks both.

* BUG: Argument to read should be int not str

Old behavior is to read everything, which will happen if I pass no argument.

---------

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 22, 2025
@charris charris removed this from the 2.3.2 release milestone Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I think key is a string and read() expects an int. Should this be just
3 participants