Skip to content

BUG: Ensure seed sequences are restored through pickling (#26260) - #26293

Merged
charris merged 2 commits into
numpy:maintenance/2.0.xfrom
charris:backport-26260
Apr 17, 2024
Merged

charris merged 2 commits into
numpy:maintenance/2.0.xfrom
charris:backport-26260

Conversation

@charris

@charris charris commented Apr 16, 2024

Copy link
Copy Markdown
Member

Backport of #26260.

Explicity store and restore seed sequence

closes #26234


  • BUG: Ensure seed sequences are restored through pickling

Explicity store and restore seed sequence

closes #26234

  • CLN: Simplify refactor

Make more use of set and getstate to avoid changes in the pickling functions

  • BUG: Correct behavior for legacy pickles

Add test for legacy pickles
Include pickles for tests

  • MAINT: Correct types for pickle related functions

  • REF: Switch from string to type

  • REF: Swtich to returning bit generators

Explicitly return bit generator rather than ctor

Explicity store and restore seed sequence

closes numpy#26234

---

* BUG: Ensure seed sequences are restored through pickling

Explicity store and restore seed sequence

closes numpy#26234

* CLN: Simplify refactor

Make more use of set and getstate to avoid changes in the pickling functions

* BUG: Correct behavior for legacy pickles

Add test for legacy pickles
Include pickles for tests

* MAINT: Correct types for pickle related functions

* REF: Switch from string to type

* REF: Swtich to returning bit generators

Explicitly return bit generator rather than ctor
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Apr 16, 2024
@charris

charris commented Apr 16, 2024

Copy link
Copy Markdown
Member Author

Hmm, the test failures are all on Python 3.9 and seem to involve typing.

@charris

charris commented Apr 16, 2024

Copy link
Copy Markdown
Member Author

I think the easiest thing here is to just leave this for NumPy 2.1.0, which isn't that far off.

@charris

charris commented Apr 16, 2024

Copy link
Copy Markdown
Member Author

@BvB93 Any thoughts about what changed between Python 3.9 and 3.10?

Comment thread numpy/random/_pickle.py Resolved
@charris

charris commented Apr 17, 2024 •

Copy link
Copy Markdown
Member Author

Thanks Bas. This change is probably needed in main as well because we still support Python 3.10.

EDIT: python 3.11 3.10. OK, we don't need it for 3.10.

@charris
charris merged commit b161a9e into numpy:maintenance/2.0.x Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants