-
Notifications
You must be signed in to change notification settings - Fork 286
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
Use partial to make cube pickleable #4377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjbenfold This is lovely 🤩
But let's add some pickling test coverage, as there's clearly a gap that definitely needs filled 👍
Then let's bank this. Great job!
Not sure this is the right place to put these tests - it's a bit odd that we're not testing a function of cube. Checked that the third test fails against the version of cube.py on main. Not sure if it's worth checking any other cube methods preserve the ability to pickle, none stood out as likely to affect it. Will rebase and update what's new when @bjlittle is happy with everything else |
It might be better to add them onto the existing : |
Done, thanks! |
@wjbenfold Do you mind also resolving the conflicts on this PR? |
aaf4030
to
5347161
Compare
After more faffing than strictly necessary, this is now rebased |
@wjbenfold Absolutely not your doing... but due to our tardy efforts to review this PR it's gone stale again 😢 Please rebase to resolve the conflict, then we'll get it across the line 🙏 |
bfc409a
to
7b209f8
Compare
Co-authored-by: Bill Little <[email protected]>
* main: Use partial to make cube pickleable (SciTools#4377) Add edit via github method to Iris docs (SciTools#4461) Broken cartopy links in docs (SciTools#4464) rtd with latest mambaforge image for faster building (SciTools#4476) Show acceptable image test results in the docs (SciTools#4392) Nc load latlon fix (SciTools#4470) update matplotlib links (SciTools#4474) Whatsnew for PR 4462 (SciTools#4475) Clarify the return type of iris.load (AVD-1899) (SciTools#4462) [pre-commit.ci] pre-commit autoupdate (SciTools#4472) Updated environment lockfiles (SciTools#4467)
🚀 Pull Request
Description
Where previously a function was defined within cube.convert_units if the cube had lazy data, now a partial object is created instead.
The definition of a function at runtime was preventing pickling of a cube that had lazy data and was awaiting a convert_units operation. This is no longer the case. (fixes #4354)
Consult Iris pull request check list