Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jorenham
Copy link
Member

@jorenham jorenham commented Feb 8, 2025

backport of numpy/numtype#85


changes in lib._npyio :

  • add missing max_header_size kwarg to load
  • pos-only NpzFile dunder method params
  • annotate the possibility for the NpzFile.{zip,f} attrs to become None
  • add explicit parameter defaults
  • reduce code duplication using TypeAlias
  • conform to the official style guide for stubs

@jorenham jorenham added the 09 - Backport-Candidate PRs tagged should be backported label Feb 8, 2025
@jorenham jorenham added this to the 2.2.3 release milestone Feb 8, 2025
@jorenham
Copy link
Member Author

jorenham commented Feb 8, 2025

that was the last one for today

@seberg
Copy link
Member

seberg commented Feb 8, 2025

This seems like quite a bit of changes. Unless these are related to regressions, I am really not sure that we should backport it and risk other regressions (and also bug fixes/new features can create regressions).

@jorenham

This comment was marked as outdated.

@jorenham
Copy link
Member Author

jorenham commented Feb 8, 2025

I partially reverted the changes to the lib.npyio.NpzFile attributes, so it should be fully backwards-compatible now.

@charris charris merged commit 11cc665 into numpy:main Feb 8, 2025
66 of 70 checks passed
@charris
Copy link
Member

charris commented Feb 8, 2025

Thanks Joren.

@jorenham jorenham deleted the numtype-85 branch February 8, 2025 19:08
charris added a commit to charris/numpy that referenced this pull request Feb 8, 2025
Backports of the following PRs:
    numpy#28295, numpy#28296, numpy#28297, numpy#28298, numpy#28299,
    numpy#28300, numpy#28301, numpy#28302 numpy#28303

Squashed commits of the following:

commit a9267179555caf49c109a13560c3af81b7fc2a7a
Author: jorenham <[email protected]>
Date:   Sat Feb 8 16:51:24 2025 +0100

    TYP: stub ``lib._datasource`` and fix ``lib._npyio_impl``

commit 443ae333a12abecfad6faa32a55008d2312c7d92
Author: jorenham <[email protected]>
Date:   Sat Feb 8 16:22:58 2025 +0100

    TYP: fix and improve ``numpy._core.arrayprint``

commit 3bf77939042838edb417507ec2099951c7ad804b
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:57:32 2025 +0100

    TYP: stub ``lib.recfunctions``

commit 80319f25c499a2b87eb271a9e7a81bb0ce3e1f85
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:52:10 2025 +0100

    TYP: stub ``lib.introspect``

commit 1d693e9601aaf9f5bb5a915385cc52a0162efcff
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:49:53 2025 +0100

    TYP: stub ``lib.user_array`` and ``lib._user_array_impl``

commit d56f22f263ddf02a01fc15bf576862c51f22addd
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:45:36 2025 +0100

    TYP: stub ``numpy.lib._iotools``

commit ca2024aa706a85a5011c2bb55aba29e5d5da40bd
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:39:59 2025 +0100

    TYP: stub ``numpy._configtool`` and ``numpy._distributor_init``

commit ec7fdc9ca259b4fedfbb88f606818271fed63ee0
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:36:46 2025 +0100

    TYP: stub ``numpy._expired_attrs_2_0``

commit f2f078c4f81065dcf0855d95067d7c32686e972f
Author: jorenham <[email protected]>
Date:   Sat Feb 8 15:30:32 2025 +0100

    TYP: stub ``numpy._globals``
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Feb 8, 2025
@seberg
Copy link
Member

seberg commented Feb 9, 2025

But apart from those two, I don't see anything else that could lead to backwards incompatible issues

That is good then, but stay aware that any non-trivial change can introduce a new bug or behavior change by accident. So if a change isn't simple and the bug it it fixes is not bad, then just waiting for the new release is better IMO.

EDIT: Basically: if any user starts pinning bug-releases due to it breaking their CI often, then IMO, we backported too agressively.

@jorenham
Copy link
Member Author

jorenham commented Feb 9, 2025

Do you think that new stubs for previously unstubbed modules (which I personally consider a bug, but I'm probably biased) should be backported, @seberg ?

@seberg
Copy link
Member

seberg commented Feb 9, 2025

The size just made me paus. I guess I don't care about new stubs as such if/since they cannot cause regressions for anyone? Seems also a bit unnecessary. Although, maybe they are different from new features.

@jorenham jorenham added the numtype Isssue/PR related to numpy/numtype label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
41 - Static typing numtype Isssue/PR related to numpy/numtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants