Skip to content
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

FIX: Bug in random generator persistence #331

Merged

Conversation

BenjaminBossan
Copy link
Collaborator

@BenjaminBossan BenjaminBossan commented Mar 28, 2023

Fixes #329

One of its children was not persisted correctly (pure dict instead of DictNode), which made it impossible to check the untrusted types on it. This fix correctly stores the state as a node.

Note that the old implementation does correctly load the Generator instance, but it doesn't work with anything but trusted=True.

Tests were extended to uncover this bug.

The old persistence scheme was preserved for protocol vesion 0 -- even though it is buggy, it can work under some circumstances.

One of its children was not persisted correctly (pure dict instead of
DictNode), which made it impossible to check the untrusted types on it.
This fix correctly stores the state as a node.

Tests were extended to uncover this bug.

The old persistence scheme was preserved for protocol vesion 0 -- even
though it is buggy, it can work under some circumstances.
@BenjaminBossan
Copy link
Collaborator Author

@skops-dev/maintainers ready for review

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

This needs a changelog, otherwise LGTM.

@adrinjalali adrinjalali merged commit deaf6e2 into skops-dev:main Mar 28, 2023
@BenjaminBossan BenjaminBossan deleted the fix-random-generator-persistence branch March 28, 2023 13:55
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.

Bug: numpy default rng persistence
2 participants