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

attempt to restore support for very old pickle files #1656

Merged
merged 2 commits into from Jan 31, 2018

Conversation

ngoldbaum
Copy link
Member

This is in response to Jason Tumlinson on the mailing list. They supplied a pickle file created with an old version of yt. Apparently on this version there was no unit lookup-table saved at all and instead just a number, which I'm interpreting as the unit name. It's possible that this will break for other old pickle files but this will at least allow yt to load the one example we know of.

Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

This looks good to me -- seems like catching it in a try/except should keep it from impeding perf on current files. Nice catch.

unit, lut = state[0]
try:
unit, lut = state[0]
except TypeError:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you should add a comment here to state that this make the very old pickle files work. Otherwise the code looks a bit cryptic.

@ngoldbaum ngoldbaum merged commit 609c600 into yt-project:master Jan 31, 2018
@ngoldbaum ngoldbaum deleted the pickle-old-format branch December 11, 2018 15:34
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.

None yet

4 participants