3 ms·
I think (and this isn't just personal experience) most of the appeal of Jupyter is the fractioned persistent state that allows you to write incrementally but no
by thanatropism 8y ago
I think (and this isn't just personal experience) most of the appeal of Jupyter is the fractioned persistent state that allows you to write incrementally but not re-run increasingly long scripts. Inline plots are just gravy.
(Yes yes write documents export LaTeX. Not sure people care about this at all)
I've been developing a style where development "cells" are cached with joblib.Memory so re-running a script from command line doesn't take idiotic amounts of time. Further, I have litte context managers such that
with Figure('filename.png'): plotting_logic()
exports a file that immediately shows in the folder navigation bar of Atom. It's overall a better experience.
What I would really like is being able to use joblib.Memory not as a decorator (which requires bunching up your "cells" in functions and calling them separately) but as a context manager.
---
To the tune of the "Portlandia" song: the dream of MUMPS state is alive in joblib...
- mirashii 8y agoYou can actually do this as a context manager, I have done something very similar in the past. I created a dummy context manager with a unique name and used an importhook to do an AST rewrite to the body of the context manager. It's a bit of a hack (okay, a lot of a hack), but allows for some really neat patterns that context managers didn't allow.