3 ms·
I wish that Jupyter used some kind of similar trick, to allow quickly recalculating a workbook starting at some cell.
by CJefferson 8y ago
I wish that Jupyter used some kind of similar trick, to allow quickly recalculating a workbook starting at some cell.
- deleted 8y ago[deleted]
- Waterluvian 8y agoIf a notebook was written functionally without side effects, couldn't each function be explicitly or implicitly decorated with an @memoized ?
- dooglius 8y agoThat's not really how notebooks are written, at least in my experience. Even if there aren't side effects, work is often done at the lowest level without defining functions at all. Also, the fact that function definitions can change makes it tricky, and I suspect you'd run into lots of subtle issues: e.g. if you modified a function foo and a subsequent function bar calls foo, then I think calls to bar would return stale memoized data.
- Waterluvian 8y agoYes, agreed. I'm spitballing. I was thinking about how a hypothetical type of notebook could be structured in frames, where each frame can have side effects, but ultimately its input comes from the output of the previous frame. So each frame could be memoized. The UI could indicate what frames are being re-processed. I'm basically thinking about ArcGIS Model Builder[1] that I used a lot in university. It was a great way to make complex process pipelines for GIS data, but only re-run the pieces that change. It allowed me to experiment at a very fast pace. [1] http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/modelbuilder/what-is-modelbuilder-.htm http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing...
- thomasballinger 8y agoThe Jupyter models is hard for this, but if you only allow in-order execution (like a repl, say IPython whose kernel is used in Jupyter) you could do something like this. We tried plugging in the rlundo tool https://github.com/thomasballinger/rlundo https://github.com/thomasballinger/rlundo to IPython, it works ok, see http://ballingt.com/interactive-interpreter-undo/ http://ballingt.com/interactive-interpreter-undo/ for the long story. I wanted something like this for live programming and felt like I needed to write my own interpreter because the behavior you need is so different: http://dalsegno.ballingt.com http://dalsegno.ballingt.com