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

Cannot save jams with random seeds #74

Closed
bmcfee opened this issue Nov 13, 2019 · 0 comments · Fixed by #75
Closed

Cannot save jams with random seeds #74

bmcfee opened this issue Nov 13, 2019 · 0 comments · Fixed by #75
Assignees
Labels
Milestone

Comments

@bmcfee
Copy link
Owner

bmcfee commented Nov 13, 2019

This is a regression introduced by #70 -- randomized deformers now have a random state field (deformer.rng) which is of type RandomState. This type is not JSON-serializable. When we go to save the output of a deformation (via JAMS), the encoder fails.

The easiest fix here is probably something like the following:

  • Move all rng fields to _rng so that JAMS skips them during serialization
  • Persist the random seeds in deformers as a separate field rng that is serialized. Raise a warning about serialization if the input is not serializable.

Since this breaks the object model a little bit, we'll need to bump the version number.

@bmcfee bmcfee added the bug label Nov 13, 2019
@bmcfee bmcfee added this to the 0.4.0 milestone Nov 13, 2019
@bmcfee bmcfee self-assigned this Nov 13, 2019
bmcfee added a commit that referenced this issue Nov 13, 2019
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 a pull request may close this issue.

1 participant