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

Enable Pickling of Tallies #468

Merged
merged 13 commits into from
Oct 29, 2024
Merged

Enable Pickling of Tallies #468

merged 13 commits into from
Oct 29, 2024

Conversation

tjlaboss
Copy link
Collaborator

@tjlaboss tjlaboss commented Aug 2, 2024

Description

This PR first demonstrated failures for inputs involving tallies. It has since been expanded to resolve #463.

Update from @MicahGale, and fixes:

This bug is related to sly Yacc descended objects. Basically they can end up in states where they cannot be pickled. The first issue is that sometimes they keep parser.tokens as a generator. The other is that they will store a parser.production which has a lot of lambda functions, and closures. None of these are allowed for copying or pickling. To fix this I:

  1. blanked out parser.tokens when complete.
  2. Prevented _parser from being pickled as it isn't needed.

Fixes #463.

checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@MicahGale MicahGale added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Aug 16, 2024
@MicahGale MicahGale mentioned this pull request Aug 17, 2024
@tjlaboss tjlaboss added the wontfix This will not be worked on label Aug 21, 2024
@MicahGale MicahGale added low priority and removed wontfix This will not be worked on labels Aug 22, 2024
@MicahGale
Copy link
Collaborator

Might fix this one day.

@MicahGale MicahGale marked this pull request as ready for review September 10, 2024 14:44
@MicahGale MicahGale marked this pull request as draft September 10, 2024 14:44
@MicahGale
Copy link
Collaborator

I'm really hoping that #539 fixes most of the issues here.

@MicahGale
Copy link
Collaborator

Ok didn't fix it. But at least now there isn't infinite recursion to deal with while debugging.

@tjlaboss
Copy link
Collaborator Author

progress

@MicahGale MicahGale marked this pull request as ready for review October 15, 2024 22:05
@MicahGale MicahGale marked this pull request as draft October 15, 2024 22:05
@MicahGale MicahGale self-assigned this Oct 29, 2024
@MicahGale MicahGale self-requested a review October 29, 2024 22:44
@MicahGale MicahGale assigned tjlaboss and unassigned MicahGale Oct 29, 2024
@MicahGale MicahGale marked this pull request as ready for review October 29, 2024 22:47
@MicahGale
Copy link
Collaborator

I know you opened this PR @tjlaboss, but want to review it since I did all the fixes here?

@tjlaboss tjlaboss changed the title Test an input with tallies Enable Pickling of Tallies Oct 29, 2024
@tjlaboss
Copy link
Collaborator Author

Approved.

@MicahGale MicahGale merged commit 2f9a0c1 into develop Oct 29, 2024
20 checks passed
@MicahGale MicahGale deleted the pickle_tallies branch October 29, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error pickling MCNP_Problem: Cannot pickle 'generator' object
2 participants